Das Notes Forum

Domino 9 und frühere Versionen => ND6: Entwicklung => Thema gestartet von: TSchaefer am 19.10.04 - 23:00:33

Titel: TAPI Telefonwahl -Auflegen
Beitrag von: TSchaefer am 19.10.04 - 23:00:33
Hallo liebe Leute,

ist schon ein biserl her das ich hier war.
Muss leider seit einem Jahr Visual Fox Pro Proggen und habe kaum noch Zeit für Notes.
Aber zum Problem. Ich habe mir vor langer Zeit aus einer Reihe Code ein Anwahlroutine zusammengestellt (Danke Eknori). Das Problem ist mein Chef ist ein wenig Fauler geworden er will jetzt auch einen Auflegebutton.
Ich habe zwar schon gesucht aber finde keinee Aufruf um das bestehende Gespräch zubeenden.

Unten ist der Code der Anwahl.
 Vielen Dank für alle Tipps

Torsten


Sub Click(Source As Button)
   
   On Error Goto Error_Handler   
   Dim s As New NotesSession
   Dim ws As New NotesUIWorkspace
   Dim doc As NotesDocument
   Dim strPhoneNumber As String
   Dim strAppName As String
   Dim strCallParty As String
   Dim strComment As String
   Dim docTmp As NotesDocument
   Dim varTmp As Variant
   Dim strChoice As String
   Dim strChoiceList() As String
   Dim i As Integer, j As Integer
   Dim strKunde As String
   
   Set doc=s.CurrentDatabase.UnprocessedDocuments.GetFirstdocument
   
   If doc Is Nothing Then
      Set doc=ws.CurrentDocument.Document
   End If
   
   varTmp=Evaluate({@If((NameDisplayPref = "1" | @IsUnavailable(NameDisplayPref)) & (af_Ansprech !="" | af_AnsprechV != "");@Trim(@Subset(af_Ansprech;1))+@If(af_AnsprechV !="";" , "+@Trim(@Subset(af_AnsprechV;1));"");NameDisplayPref="2" & (af_Ansprech!="" | af_AnsprechV !=""); @Trim(@Subset(af_Ansprech;1)) + @If(af_AnsprechV!="";" , "+@Trim(@Subset(af_AnsprechV;1));"");af_KdName)},doc)
   strCallParty=varTmp(0)
   strAppName="Notes Dialer"
   strComment="Automatic Dialing"
   strKunde="Hallo"
   If Not doc Is Nothing Then
      i=0
      'af_telefon
      If doc.af_telefon(0)<>"" Then
         varTmp=doc.af_telefon
         For j=Lbound(varTmp) To Ubound(varTmp)
            Redim Preserve strChoiceList(i)
            strChoiceList(i)=doc.af_Ansprech(0)+":"+Chr$(9)+varTmp(j)
            i=i+1
         Next
      End If
      
      'af_telefon_1
      If doc.af_telefon_1(0)<>"" Then
         varTmp=doc.af_telefon_1
         For j=Lbound(varTmp) To Ubound(varTmp)
            Redim Preserve strChoiceList(i)
            strChoiceList(i)=doc.af_Ansprech_1(0)+":"+Chr$(9)+varTmp(j)
            i=i+1
         Next
      End If
      
      'af_telefon_2
      If doc.af_telefon_2(0)<>"" Then
         varTmp=doc.af_telefon_2
         For j=Lbound(varTmp) To Ubound(varTmp)
            Redim Preserve strChoiceList(i)
            strChoiceList(i)=doc.af_Ansprech_2(0)+":"+Chr$(9)+varTmp(j)
            i=i+1
         Next
      End If
      
      'af_telefon
      If doc.af_telefon_3(0)<>"" Then
         varTmp=doc.af_telefon_3
         For j=Lbound(varTmp) To Ubound(varTmp)
            Redim Preserve strChoiceList(i)
            strChoiceList(i)=doc.af_Ansprech_3(0)+":"+Chr$(9)+varTmp(j)
            i=i+1
         Next
      End If
      
      'af_telefon
      If doc.af_telefon_4(0)<>"" Then
         varTmp=doc.af_telefon_4
         For j=Lbound(varTmp) To Ubound(varTmp)
            Redim Preserve strChoiceList(i)
            strChoiceList(i)=doc.af_Ansprech_4(0)+":"+Chr$(9)+varTmp(j)
            i=i+1
         Next
      End If
      
      'af_telefon_5
      If doc.af_telefon_5(0)<>"" Then
         varTmp=doc.af_telefon_5
         For j=Lbound(varTmp) To Ubound(varTmp)
            Redim Preserve strChoiceList(i)
            strChoiceList(i)=doc.af_Ansprech_5(0)+":"+Chr$(9)+varTmp(j)
            i=i+1
         Next
      End If
      
      'af_telefon
      If doc.af_telefon_6(0)<>"" Then
         varTmp=doc.af_telefon_6
         For j=Lbound(varTmp) To Ubound(varTmp)
            Redim Preserve strChoiceList(i)
            strChoiceList(i)=doc.af_Ansprech_6(0)+":"+Chr$(9)+varTmp(j)
            i=i+1
         Next
      End If
      
      'af_cell
      If doc.af_cell(0)<>"" Then
         varTmp=doc.af_cell
         For j=Lbound(varTmp) To Ubound(varTmp)
            Redim Preserve strChoiceList(i)
            strChoiceList(i)=doc.af_Ansprech(0)+":"+Chr$(9)+varTmp(j)
            i=i+1
         Next
      End If
      
      'Home
      If doc.PhoneNumber(0)<>"" Then
         varTmp=doc.PhoneNumber
         For j=Lbound(varTmp) To Ubound(varTmp)
            Redim Preserve strChoiceList(i)
            strChoiceList(i)=doc.PhoneLabel_2(0)+":"+Chr$(9)+varTmp(j)
            i=i+1
         Next
      End If
      
      'OfficeFax
      If doc.OfficeFaxPhoneNumber(0)<>"" Then
         varTmp=doc.OfficeFaxPhoneNumber
         For j=Lbound(varTmp) To Ubound(varTmp)
            Redim Preserve strChoiceList(i)
            strChoiceList(i)=doc.PhoneLabel_3(0)+":"+Chr$(9)+varTmp(j)
            i=i+1
         Next
      End If
      
      'HomeFax
      If doc.HomeFaxPhoneNumber(0)<>"" Then
         varTmp=doc.HomeFaxPhoneNumber
         For j=Lbound(varTmp) To Ubound(varTmp)
            Redim Preserve strChoiceList(i)
            strChoiceList(i)=doc.PhoneLabel_4(0)+":"+Chr$(9)+varTmp(j)
            i=i+1
         Next
      End If
      
      'Pager
      If doc.PhoneNumber_6(0)<>"" Then
         varTmp=doc.PhoneNumber_6
         For j=Lbound(varTmp) To Ubound(varTmp)
            Redim Preserve strChoiceList(i)
            strChoiceList(i)=doc.PhoneLabel_6(0)+":"+Chr$(9)+varTmp(j)
            i=i+1
         Next
      End If
      
      strChoice = ws.Prompt(PROMPT_OKCANCELLIST, "Wählen: " & strCallParty, "Welchen Teilnehmer von Kunde: " & strKunde , strChoiceList(0), strChoiceList)
      strPhoneNumber=Trim$(Right$(strChoice, Len(strChoice)-Instr(strChoice,Chr$(9) ) ) )
      
      If Instr(strPhoneNumber," x") Then strPhoneNumber=Left$(strPhoneNumber,Instr(strPhoneNumber, " x")-1)
      If Trim(strPhoneNumber) <>"" Then Call tapiRequestMakeCall(strPhoneNumber,strAppName,strCallParty,strComment)
   End If
TheEnd:
   Exit Sub
   
Error_Handler:
   Resume TheEnd   
End Sub
Titel: Re: TAPI Telefonwahl -Auflegen
Beitrag von: umi am 20.10.04 - 13:23:00
Interressant wäre noch die Sub tapiRequestMakeCall()
Titel: Re: TAPI Telefonwahl -Auflegen
Beitrag von: TSchaefer am 20.10.04 - 13:56:24
Also hier:


Declare Sub tapiRequestMakeCall Lib "TAPI32" (Byval lpszDestAddress$,Byval lpszAppName$, Byval lpszCalledParty$, Byval lpszComment$)


Bitte schön.
Damit kannst du aber nur wählen!!! Auflegen ist dann das Problem.

Hat denn keiner eine Idee ???

Gruß

Torsten
Titel: Re: TAPI Telefonwahl -Auflegen
Beitrag von: eknori am 20.10.04 - 14:06:21
entweder mit lineClose oder mit LineDrop aus der TAPI32.DLL

http://www.activevb.de/rubriken/apikatalog/bylib/bylib129.html

Titel: Re: TAPI Telefonwahl -Auflegen
Beitrag von: TSchaefer am 20.10.04 - 14:47:01
@ Eknori

Vielen Dank,
ich habe das gerade ausprobiert.
Weiss aber nicht wirklich wie ich den richtigen Parameter für
  hline herausbekomme ?

Ergo es passiert nix

Ich glaube ich werde noch mal C lernen müssen ;-)

Gruß
Torsten