English
Forum

TAPI-trouble

 

Matthias
Arlt
Hello into round

I have me time in the network umgesehen and me from some VB- and Delphi-Codes following TAPI-routine zusammengebastelt. The functions so far too. at that appeal of linemakecall becomes The link too correctly aufgebaut. though knallts then with the known Message Anwendungsfehler: Exception....... I have already Verschiedenes durchprobiert, but without positives Result. and before I here somehow verrenne, hope I very on Your helpful ideas.
here time the code:
Def LineInit(5) !tapi32,lineInitialize
Def LineInitEx(7) !tapi32,lineInitializeExA
Def LineNegotiateAPIVersion(6) !tapi32,lineNegotiateAPIVersion
Def LineGetDevCaps(5) !tapi32,lineGetDevCaps
Def LineOpen(9) !tapi32,lineOpenA
Def LineSetStatusMessages(3) !tapi32,lineSetStatusMessages
Def LineMakeCall(5) !tapi32,lineMakeCall
Def LineShutdown(1) !tapi32,lineShutdown
declare TapiHdl#,TapiHdl&,TapiNumDevs#,TapiCallBack#,TapiVer#,extID#,ghLine#,ghCall#
declare TapiLineDevCaps#,LineCallParams#,TapiReturn&,TapiDevs&,ChooseDev&,DialNumber$
DialNumber$=123456 fiktive phone number

proc MakeTapiCall

    dim TapiHdl#,4
    dim TapiCallBack#,4
    dim TapiNumDevs#,4
    dim extID#,16
    dim ghLine#,4
    dim ghCall#,4
    dim TapiVer#,4
    long TapiVer#,0=$00020000	dwTapiVersion
    dim TapiLineDevCaps#,270
    long TapiLineDevCaps#,0=270     dwTotalSize
    dim LineCallParams#,236
    long LineCallParams#,0=236      dwTotalSize
    long LineCallParams#,4=1        dwBearerMode = LINEBEARERMODE_VOICE
    long LineCallParams#,16=4       dwMediaMode = LINEMEDIAMODE_INTERACTIVEVOICE
    long LineCallParams#,4=8        dwBearerMode = LINEBEARERMODE_DATA
    long LineCallParams#,16=16      dwMediaMode = LINEMEDIAMODE_DATAMODEM
    long LineCallParams#,20=2       dwCallParamFlags = LINECALLPARAMFLAGS_IDLE
    long LineCallParams#,24=1       dwAddressMode = LINEADDRESSMODE_ADDRESSID
    long LineCallParams#,28=0       dwAddressID
    TAPI initialisieren:
    TapiReturn&=LineInit(TapiHdl#,%hinstance,TapiCallBack#,0,TapiNumDevs#)
    TapiReturn&=LineInitEx(TapiHdl#,%hinstance,TapiCallBack#,0,TapiNumDevs#,TapiVer#,0)
    print LineInitEx +st$(TapiReturn&)
    TapiHdl&=long(TapiHdl#,0)
    TapiDevs&=long(TapiNumDevs#,0)
    print TapiNumDevs +st$(long(TapiNumDevs#,0))
    any Tapi-Devices inquire To modem found...
    ChooseDev&=0

    whileloop TapiDevs&

        ChooseDev& = &loop - 1
        pub To verwendende API-Version aushandeln:
        TapiReturn&=LineNegotiateAPIVersion(TapiHdl&,ChooseDev&,$00020000,$00030000,TapiVer#,extID#)
        print NegotiateAPI +st$(TapiReturn&)
        print LocalAPI $000+hex$(long(TapiVer#,0))

        if TapiReturn& = 0

            Device-Parameter inquire:
            TapiReturn&=LineGetDevCaps(TapiHdl&,ChooseDev&,long(TapiVer#,0),0,TapiLineDevCaps#)
            print GetDevCaps +st$(TapiReturn&)
            print dwBearerModes +st$(long(TapiLineDevCaps#,52))
            print dwMaxRate +st$(long(TapiLineDevCaps#,56))
            print dwMediaModes +st$(long(TapiLineDevCaps#,60))

            if TapiReturn& = 0

                if modem found...

                ifnot (long(TapiLineDevCaps#,52)=1) and (long(TapiLineDevCaps#,56)>=9600) and (long(TapiLineDevCaps#,60)=16)

                    if (long(TapiLineDevCaps#,52)=1) or (long(TapiLineDevCaps#,56)>=9600) or (long(TapiLineDevCaps#,60)=16)

                        clear ghLine#
                        TapiReturn&=LineOpen(TapiHdl&,ChooseDev&,ghLine#,long(TapiVer#,0),0,0,1,0,0)
                        print LineOpen +st$(TapiReturn&)

                        if TapiReturn& = 0

                            TapiReturn&=LineSetStatusMessages(long(ghLine#,0),$2+$4+$8+$80+$100+$400+$40000,1)
                            print SetStatusMessages +st$(TapiReturn&)

                            if TapiReturn& = 0

                                print Anwahl of +DialNumber$+  with unit +st$(ChooseDev&)
                                clear ghCall#
                                TapiReturn&=LineMakeCall(long(ghLine#,0),ghCall#,addr(DialNumber$),0,LineCallParams#)
                                print MakeCall +st$(TapiReturn&)
                                messagebox(Anwahl successful !,,0)
                                print Anwahl successful !
                                case TapiHdl& <> 0 : LineShutdown(TapiHdl&)
                                break

                            endif

                        endif

                        case TapiHdl& <> 0 : LineShutdown(TapiHdl&)

                    endif

                endif

            endif

        endif

    wend

    dispose TapiHdl#
    dispose TapiNumDevs#
    dispose extID#
    dispose ghLine#
    dispose ghCall#
    dispose TapiCallBack#
    dispose TapiVer#
    dispose TapiLineDevCaps#
    dispose LineCallParams#

endproc

cls
MakeTapiCall
waitinput

Matthias
 
WinXP SP2, Win7 - XProfan 10/11/FreeProfan32 - Xpia
01/23/08  
 



with both Profanversionen (Profan 7 ff. / 9.1sh) crash on yourself place?

unfortunately have I no tapifähiges unit circa it really testing to...

PS: Codes not
separate in [CODE]
 
01/23/08  
 




Matthias
Arlt
Hello IF
Yes, crash on same place. with the Difference, that with Profan 7 The link until Wegklicken the Error Message consist remaining and with XProfan immediate, means yet during the Wahlvorgangs abbricht. be therefore something ratlos...

In CODE instead of in BOX: Yes, really clear. I have momentarily testweise a smaller Monitor in use with only 800x600. there can the XProfan-Page something difficult manage. and there happens the already time...
 
WinXP SP2, Win7 - XProfan 10/11/FreeProfan32 - Xpia
01/23/08  
 



could You time a directory c:p00x lay out and subesquent code perform?
proc __xpse__endofprogram__

    REM {{SOMEEXTRAENDCOMMAND}}
    end

endproc

DECLARE TAPIHDL#,TAPIHDL&,TAPINUMDEVS#,TAPICALLBACK#,TAPIVER#,EXTID#,GHLINE#,GHCALL#,TAPILINEDEVCAPS#,LINECALLPARAMS#,TAPIRETURN&,TAPIDEVS&,CHOOSEDEV&,DIALNUMBER$
declare __gallog__%
__gallog__%=0

proc __log__

    parameters u$,s$
    assign #89,C:P00X	api.debug
    append #89
    print #89,mkstr$(chr $(9),__gallog__%)+s$
    close #89
    return u$

endproc

assign #89,C:P00X	api.debug
rewrite #89
close #89
__log__ @$(0), DEF LINEINIT(5) !*tapi32*,*lineInitialize*
DEF LINEINIT(5) !tapi32,lineInitialize
__log__ @$(0), DEF LINEINITEX(7) !*tapi32*,*lineInitializeExA*
DEF LINEINITEX(7) !tapi32,lineInitializeExA
__log__ @$(0), DEF LINENEGOTIATEAPIVERSION(6) !*tapi32*,*lineNegotiateAPIVersion*
DEF LINENEGOTIATEAPIVERSION(6) !tapi32,lineNegotiateAPIVersion
__log__ @$(0), DEF LINEGETDEVCAPS(5) !*tapi32*,*lineGetDevCaps*
DEF LINEGETDEVCAPS(5) !tapi32,lineGetDevCaps
__log__ @$(0), DEF LINEOPEN(9) !*tapi32*,*lineOpenA*
DEF LINEOPEN(9) !tapi32,lineOpenA
__log__ @$(0), DEF LINESETSTATUSMESSAGES(3) !*tapi32*,*lineSetStatusMessages*
DEF LINESETSTATUSMESSAGES(3) !tapi32,lineSetStatusMessages
__log__ @$(0), DEF LINEMAKECALL(5) !*tapi32*,*lineMakeCall*
DEF LINEMAKECALL(5) !tapi32,lineMakeCall
__log__ @$(0), DEF LINESHUTDOWN(1) !*tapi32*,*lineShutdown*
DEF LINESHUTDOWN(1) !tapi32,lineShutdown
__log__ @$(0), DIALNUMBER$=*725372*
DIALNUMBER$=725372
__log__ @$(0), #DEFINE PROCEDURE { proc MAKETAPICALL }/* LINE:12
proc MAKETAPICALL
__log__ @$(0), PROCEED PROCEDURE { proc MAKETAPICALL } /* LINE:12 {
inc __gallog__%
__log__ @$(0), DIM TAPIHDL#,4
DIM TAPIHDL#,4
__log__ @$(0), DIM TAPICALLBACK#,4
DIM TAPICALLBACK#,4
__log__ @$(0), DIM TAPINUMDEVS#,4
DIM TAPINUMDEVS#,4
__log__ @$(0), DIM EXTID#,16
DIM EXTID#,16
__log__ @$(0), DIM GHLINE#,4
DIM GHLINE#,4
__log__ @$(0), DIM GHCALL#,4
DIM GHCALL#,4
__log__ @$(0), DIM TAPIVER#,4
DIM TAPIVER#,4
__log__ @$(0), LONG TAPIVER#,0=$00020000
LONG TAPIVER#,0=$00020000
__log__ @$(0), DIM TAPILINEDEVCAPS#,270
DIM TAPILINEDEVCAPS#,270
__log__ @$(0), LONG TAPILINEDEVCAPS#,0=270
LONG TAPILINEDEVCAPS#,0=270
__log__ @$(0), DIM LINECALLPARAMS#,236
DIM LINECALLPARAMS#,236
__log__ @$(0), LONG LINECALLPARAMS#,0=236
LONG LINECALLPARAMS#,0=236
__log__ @$(0), LONG LINECALLPARAMS#,4=1
LONG LINECALLPARAMS#,4=1
__log__ @$(0), LONG LINECALLPARAMS#,16=16
LONG LINECALLPARAMS#,16=16
__log__ @$(0), LONG LINECALLPARAMS#,20=2
LONG LINECALLPARAMS#,20=2
__log__ @$(0), LONG LINECALLPARAMS#,24=1
LONG LINECALLPARAMS#,24=1
__log__ @$(0), LONG LINECALLPARAMS#,28=0
LONG LINECALLPARAMS#,28=0
__log__ @$(0), TAPIRETURN&=LINEINIT(TAPIHDL#,%HINSTANCE,TAPICALLBACK#,0,TAPINUMDEVS#)
TAPIRETURN&=LINEINIT(TAPIHDL#,%HINSTANCE,TAPICALLBACK#,0,TAPINUMDEVS#)
__log__ @$(0), PRINT *LineInitEx *+STR$(TAPIRETURN&)
PRINT LineInitEx +STR$(TAPIRETURN&)
__log__ @$(0), TAPIHDL&=LONG(TAPIHDL#,0)
TAPIHDL&=LONG(TAPIHDL#,0)
__log__ @$(0), TAPIDEVS&=LONG(TAPINUMDEVS#,0)
TAPIDEVS&=LONG(TAPINUMDEVS#,0)
__log__ @$(0), PRINT *TapiNumDevs *+STR$(LONG(TAPINUMDEVS#,0))
PRINT TapiNumDevs +STR$(LONG(TAPINUMDEVS#,0))
__log__ @$(0), CHOOSEDEV&=0
CHOOSEDEV&=0
__log__ @$(0), WHILELOOP { WHILELOOP TAPIDEVS& } /* LINE:36 {
WHILELOOP TAPIDEVS&
__log__ @$(0), CHOOSEDEV&=&LOOP - 1
CHOOSEDEV&=&LOOP - 1
__log__ @$(0), TAPIRETURN&=LINENEGOTIATEAPIVERSION(TAPIHDL&,CHOOSEDEV&,$00020000,$00030000,TAPIVER#,EXTID#)
TAPIRETURN&=LINENEGOTIATEAPIVERSION(TAPIHDL&,CHOOSEDEV&,$00020000,$00030000,TAPIVER#,EXTID#)
__log__ @$(0), PRINT *NegotiateAPI *+STR$(TAPIRETURN&)
PRINT NegotiateAPI +STR$(TAPIRETURN&)
__log__ @$(0), PRINT *LocalAPI $000*+HEX$(LONG(TAPIVER#,0))
PRINT LocalAPI $000+HEX$(LONG(TAPIVER#,0))
__log__ @$(0), IF { IF TAPIRETURN&=0 } /* LINE:41 {
IF TAPIRETURN&=0
__log__ @$(0), TAPIRETURN&=LINEGETDEVCAPS(TAPIHDL&,CHOOSEDEV&,LONG(TAPIVER#,0),0,TAPILINEDEVCAPS#)
TAPIRETURN&=LINEGETDEVCAPS(TAPIHDL&,CHOOSEDEV&,LONG(TAPIVER#,0),0,TAPILINEDEVCAPS#)
__log__ @$(0), PRINT *GetDevCaps *+STR$(TAPIRETURN&)
PRINT GetDevCaps +STR$(TAPIRETURN&)
__log__ @$(0), PRINT *dwBearerModes *+STR$(LONG(TAPILINEDEVCAPS#,52))
PRINT dwBearerModes +STR$(LONG(TAPILINEDEVCAPS#,52))
__log__ @$(0), PRINT *dwMaxRate *+STR$(LONG(TAPILINEDEVCAPS#,56))
PRINT dwMaxRate +STR$(LONG(TAPILINEDEVCAPS#,56))
__log__ @$(0), PRINT *dwMediaModes *+STR$(LONG(TAPILINEDEVCAPS#,60))
PRINT dwMediaModes +STR$(LONG(TAPILINEDEVCAPS#,60))
__log__ @$(0), IF { IF TAPIRETURN&=0 } /* LINE:47 {
IF TAPIRETURN&=0
__log__ @$(0), IFNOT { IFNOT (LONG(TAPILINEDEVCAPS#,52)=1) AND (LONG(TAPILINEDEVCAPS#,56)>=9600) AND (LONG(TAPILINEDEVCAPS#,60)=16) } /* LINE:48 {
IFNOT (LONG(TAPILINEDEVCAPS#,52)=1) AND (LONG(TAPILINEDEVCAPS#,56)>=9600) AND (LONG(TAPILINEDEVCAPS#,60)=16)
__log__ @$(0), IF { IF (LONG(TAPILINEDEVCAPS#,52)=1) OR (LONG(TAPILINEDEVCAPS#,56)>=9600) OR (LONG(TAPILINEDEVCAPS#,60)=16) } /* LINE:49 {
IF (LONG(TAPILINEDEVCAPS#,52)=1) OR (LONG(TAPILINEDEVCAPS#,56)>=9600) OR (LONG(TAPILINEDEVCAPS#,60)=16)
__log__ @$(0), CLEAR GHLINE#
CLEAR GHLINE#
__log__ @$(0), TAPIRETURN&=LINEOPEN(TAPIHDL&,CHOOSEDEV&,GHLINE#,LONG(TAPIVER#,0),0,0,1,0,0)
TAPIRETURN&=LINEOPEN(TAPIHDL&,CHOOSEDEV&,GHLINE#,LONG(TAPIVER#,0),0,0,1,0,0)
__log__ @$(0), PRINT *LineOpen *+STR$(TAPIRETURN&)
PRINT LineOpen +STR$(TAPIRETURN&)
__log__ @$(0), IF { IF TAPIRETURN&=0 } /* LINE:53 {
IF TAPIRETURN&=0
__log__ @$(0), TAPIRETURN&=LINESETSTATUSMESSAGES(LONG(GHLINE#,0),$2+$4+$8+$80+$100+$400+$40000,1)
TAPIRETURN&=LINESETSTATUSMESSAGES(LONG(GHLINE#,0),$2+$4+$8+$80+$100+$400+$40000,1)
__log__ @$(0), PRINT *SetStatusMessages *+STR$(TAPIRETURN&)
PRINT SetStatusMessages +STR$(TAPIRETURN&)
__log__ @$(0), IF { IF TAPIRETURN&=0 } /* LINE:56 {
IF TAPIRETURN&=0
__log__ @$(0), PRINT *Anwahl of *+DIALNUMBER$+* with unit *+STR$(CHOOSEDEV&)
PRINT Anwahl of +DIALNUMBER$+ with unit +STR$(CHOOSEDEV&)
__log__ @$(0), CLEAR GHCALL#
CLEAR GHCALL#
__log__ @$(0), TAPIRETURN&=LINEMAKECALL(LONG(GHLINE#,0),GHCALL#,ADDR(DIALNUMBER$),0,LINECALLPARAMS#)
TAPIRETURN&=LINEMAKECALL(LONG(GHLINE#,0),GHCALL#,ADDR(DIALNUMBER$),0,LINECALLPARAMS#)
__log__ @$(0), PRINT *MakeCall *+STR$(TAPIRETURN&)
PRINT MakeCall +STR$(TAPIRETURN&)
__log__ @$(0), MESSAGEBOX(*Anwahl successful !*,**,0)
MESSAGEBOX(Anwahl successful !,,0)
__log__ @$(0), IF { IF TAPIHDL& <> 0 } /* LINE:62 {
IF TAPIHDL& <> 0
__log__ @$(0), LINESHUTDOWN(TAPIHDL&)
LINESHUTDOWN(TAPIHDL&)
ENDIF
__log__ @$(0), }
__log__ @$(0), BREAK
BREAK
ENDIF
__log__ @$(0), }
ENDIF
__log__ @$(0), }
__log__ @$(0), IF { IF TAPIHDL& <> 0 } /* LINE:68 {
IF TAPIHDL& <> 0
__log__ @$(0), LINESHUTDOWN(TAPIHDL&)
LINESHUTDOWN(TAPIHDL&)
ENDIF
__log__ @$(0), }
ENDIF
__log__ @$(0), }
ENDIF
__log__ @$(0), }
ENDIF
__log__ @$(0), }
ENDIF
__log__ @$(0), }
ENDWHILE
__log__ @$(0), }
__log__ @$(0), DISPOSE TAPIHDL#
DISPOSE TAPIHDL#
__log__ @$(0), DISPOSE TAPINUMDEVS#
DISPOSE TAPINUMDEVS#
__log__ @$(0), DISPOSE EXTID#
DISPOSE EXTID#
__log__ @$(0), DISPOSE GHLINE#
DISPOSE GHLINE#
__log__ @$(0), DISPOSE GHCALL#
DISPOSE GHCALL#
__log__ @$(0), DISPOSE TAPICALLBACK#
DISPOSE TAPICALLBACK#
__log__ @$(0), DISPOSE TAPIVER#
DISPOSE TAPIVER#
__log__ @$(0), DISPOSE TAPILINEDEVCAPS#
DISPOSE TAPILINEDEVCAPS#
__log__ @$(0), DISPOSE LINECALLPARAMS#
DISPOSE LINECALLPARAMS#
dec __gallog__%
__log__ @$(0), }
endproc
__log__ @$(0), CLS
CLS
__log__ @$(0), MAKETAPICALL
MAKETAPICALL
__log__ @$(0), WAITINPUT
WAITINPUT
__log__ @$(0), REM ---ENDOFFILE---
REM ---ENDOFFILE---
__xpse__endofprogram__

...and subsequently The c:p00xapi.debug here post?
 
01/23/08  
 




Matthias
Arlt
already Done ! Debug-File in the attachment.

3 kB
Hochgeladen:01/23/08
Downloadcounter316
Download
 
WinXP SP2, Win7 - XProfan 10/11/FreeProfan32 - Xpia
01/23/08  
 



The Messagebox Anwahl successful ! appear and remaining To You these closes?

Unausreichende Bereichsdimensionierung or one Callbackproblem - but this is mere speculative.
 
01/23/08  
 




Matthias
Arlt
Yes, The Messagebox remaining until Closing. The Bereichsdimensionierung I had too first in suspicion, have but already probehalber The values vervielfacht. unfortunately no Änderung...
 
WinXP SP2, Win7 - XProfan 10/11/FreeProfan32 - Xpia
01/23/08  
 



lpfnCallback, Third Param lineInitializeEx ought to one Long his, The address of/ one procedure which with procAddr To relating is. this is with you not the case - teste time...
 
01/23/08  
 




Matthias
Arlt
the CallBack... is correct, the would yet ne Possibility. i'll it testing. mandatory me but, what The usage of Callbacks in Profan angeht, first reading. Since I mainly Profan7 with well functioning and speedy Workarrounds use and everything Übrige with Assembler-Dlls resolve, be I so eigtl. not at all intimate...

and at all: Übrigens first thanks IF, for your Support. I must now first Cancel. tommorrow GEHTS moreover...

Matthias
 
WinXP SP2, Win7 - XProfan 10/11/FreeProfan32 - Xpia
01/23/08  
 




Matthias
Arlt
IF, you had right. it lying objectively on the CallBack. is now of course with of/ one completely clear procedure only a manner Dummy, but it functions still.

thanks over again
 
WinXP SP2, Win7 - XProfan 10/11/FreeProfan32 - Xpia
01/24/08  
 



gladly.

[offtopic]@Roland: *erinner*procAddrStack* - then went too korrekte wProc[/offtopic]
 
01/24/08  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

7.855 Views

Untitledvor 0 min.
Axel Berse06/10/23
rquindt05/23/16
Helmut01/12/13

Themeninformationen

this Topic has 2 subscriber:

Matthias Arlt (6x)
iF (5x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie