Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Delphi COM SendWAVE (Read 6276 times)
Kucki
YaBB Newbies
*
Offline


Phoner ist großartig!

Posts: 1
Joined: 22. Apr 2007
Delphi COM SendWAVE
22. Apr 2007 at 14:08
Print Post  
HI @all,

hab mich mal mit der COM Schnittstelle beschäftigt eigentlich klappt alles ganz super, nur wird die Ansage nie abgespielt. Was mir aufgefallen ist wenn ich den Befehl für SendWave auf nen normales Button pack und es so starte wird der Soundtrack abgespielt. Ich hab irgentwie das Gefühl der Sendet das Wave an Phoner zu früh und das der noch nicht bereit dafür ist. Allerdings frag ich ja vorher ab ob er connected ist. Was sagt ihr dazu.

Anbei Auschnitt aus der Wave Routine und Phoner Log

gruß


Delphi Code:
Quote:

procedure TForm1.CPhoner1ChangeState(ASender: TObject; CallID: Integer);
begin
if CPhoner1.GetCallInfo(CallID, State, Direction, CallerID, CalledID) <> 0 then
  begin
  if (State=Offering) and (Direction=Incoming) and (CalledID='4xxxxxxx') then
   begin
   Answer.Enabled := true; <--- hier wird kurz danach nen Answer gemacht, ist nen Timer weil ich will das er erst nach 10 sec dran geht
   MSN := CallID;
   Log.Lines.Add('Incoming Call from: '+CallerID);
   end;
  if (State=Connected)  then
   begin
    Log.Lines.Add('Connected.');
    CPhoner1.SendWAVE(MSN,'D:\Delphi\Phoner\Sounds\Ansage.wav'); <-----!!!

    LogDTMF := true;
    Pin := true;
   end;
  end;
end;


Phoner Log:
Quote:

14:03:08,796: COM: register client
14:03:22,531: Connect Indication
14:03:22,546:  CIP: 16 (telephony)
14:03:22,546:  CalledPartyNumber: 4xxxxxx
14:03:22,578:  CallingPartyNumber: 
14:03:22,578:  Additional info length: 4
14:03:22,640: phone book lookup for 0: 0 [0]
14:03:22,812: Alert Request
14:03:23,296: COM: OnChangeState(0x0101) -> Offering
14:03:23,359: COM: GetCallInfo(0x0101)
14:03:23,687: COM: OnChangeState(0x0101) -> Offering
14:03:23,687: COM: GetCallInfo(0x0101)
14:03:23,734: Alert Confirm
14:03:28,359: COM: AnswerCall(0x0101)
14:03:28,375: Connect Response: accept call
14:03:29,078: delivered connected party number:   
14:03:29,078: Connect Active Indication:   
14:03:29,078: Connect Active Response
14:03:29,078: COM: OnChangeState(0x0101) -> Connected
14:03:29,187: COM: GetCallInfo(0x0101)
14:03:29,203: COM: SendWAVE(0x0101, D:\Delphi\Phoner\Sounds\Ansage.wav)
14:03:29,203: opening wave-file: D:\Delphi\Phoner\Sounds\Ansage.wav
14:03:29,703: wave-file opened
14:03:29,765: Connect B3 Indication
14:03:29,765: Connect B3 Response: accept call
14:03:29,859: Connect B3 Active Indication
14:03:29,859: Connect B3 Active Response
14:03:30,187: WaveOut (0): open
14:03:30,500: WaveIn (0): open
14:03:30,500: waveOut opened
14:03:30,546: waveIn opened
14:03:30,656: COM: OnFilePlayed()
14:03:49,218: COM: OnChangeState(0x0101) -> Disconnecting
14:03:49,234: COM: GetCallInfo(0x0101)
14:03:49,234: Disconnect B3 Request
14:03:49,250: Disconnect B3 Confirm
14:03:49,250: Disconnect B3 Indication
14:03:49,250: Disconnect B3 Response
14:03:49,265: WaveIn (0): close
14:03:49,281: WaveOut (0): close
14:03:49,281: Disconnect Request
14:03:49,281: Disconnect Confirm
14:03:49,296: waveIn closed
14:03:49,296: waveOut closed
14:03:49,546: Info Indication: 0
14:03:49,546: Info Response
14:03:49,578: Disconnect Indication: 16:Normal call clearing
14:03:49,578: COM: OnChangeState(0x0101) -> Disconnecting
14:03:49,578: COM: GetCallInfo(0x0101)
14:03:49,718: COM: OnChangeState(0x0101) -> Disconnected
14:03:49,734: COM: GetCallInfo(0x0101)
14:03:49,734: COM: OnChangeState(0x0101) -> Idle
14:03:49,734: COM: GetCallInfo(0x0101)
14:03:49,750: active call index=0
14:03:49,750: Disconnect Response


  
Back to top
 
IP Logged
 
Phoner Admin
YaBB Administrator
*****
Offline



Posts: 11778
Location: Germany
Joined: 12. Oct 2003
Gender: Male
Re: Delphi COM SendWAVE
Reply #1 - 22. Apr 2007 at 15:25
Print Post  
Stimmt - in diesem Fall geht das so tatsächlich nicht.
Das Problem ist, dass es ein zweistufiges "connected" gibt, was sich aber nicht in der COM-Schnittstelle wiederspiegelt. Es gibt einerseits die Meldung, dass der Ruf verbunden ist und dann eben noch zusätzlich, dass der B-kanal aufgebaut ist. 
Bei einem eingehenden Ruf kommt zuerst die Meldung, dass man verbunden ist (was auch über COM gemeldet wird) und unmittelbar danach kommt von der CAPI die Meldung, dass nun auch der B-Kanal aufgebaut ist.
Bei einem abgehenden Ruf kann das jedoch vollkommen anders sein (wenn EarlyB3Connect aktiv ist). Da kann der B-Kanal schon viel früher aufgebaut sein (man hört z.B. das Klingeln vom Amt oder sogar schon das Freizeichen) und erst später, wenn dein Gegenüber abnimmt, kommt die Meldung, dass der Ruf nun verbunden ist.

In deinem Fall steht der B-Kanal noch nicht, weshalb das Senden fehlschlägt.

Es gäbe zwei Ansätze, um das Problem zu beheben:
  • Ich baue in das COM Interface noch einen zusätzliche State ein, z.B. "B3Connected". Eine Applikation wie deine müsste dann auf den anderen Event warten. Bei abgehenden Rufen jedoch müssen beide Ereignisse gemeldet wurden sein.
  • Phoner wartet ab, bis beide Ereignisse eingetroffen sind und meldet dann erst den Event zur Applikation.
  • Du verzögerst das Senden künstlich, weil davon auszugehen ist, dass unmittelbar darauf der B-Kanal auch durchgeschaltet ist.


Im Debug-Output kann man beide Ereignisse schön sehen: "Connect Active Indication:" und "Connect B3 Active Indication".
  
Back to top
WWW  
IP Logged
 
norcis
YaBB Newbies
*
Offline


Phoner ist großartig!

Posts: 11
Joined: 30. Aug 2007
Re: Delphi COM SendWAVE
Reply #2 - 31. Aug 2007 at 09:29
Print Post  
Ich kann nicht Zustand B3Connected in der COM Schnittstelle finden. Wann planst du zum implament es?



-----
Autotranslated from:
I can't find state B3Connected in COM interface. When do you plan to implament it?
  
Back to top
 
IP Logged
 
Phoner Admin
YaBB Administrator
*****
Offline



Posts: 11778
Location: Germany
Joined: 12. Oct 2003
Gender: Male
Re: Delphi COM SendWAVE
Reply #3 - 31. Aug 2007 at 10:27
Print Post  
It is not implemented, because I didn't get an answer for my previous posting. So I thought it is not necessary anymore...
  
Back to top
WWW  
IP Logged
 
norcis
YaBB Newbies
*
Offline


Phoner ist großartig!

Posts: 11
Joined: 30. Aug 2007
Re: Delphi COM SendWAVE
Reply #4 - 31. Aug 2007 at 10:36
Print Post  
Please add it to the next version of Phoner.

Thank you!

  
Back to top
 
IP Logged
 
Phoner Admin
YaBB Administrator
*****
Offline



Posts: 11778
Location: Germany
Joined: 12. Oct 2003
Gender: Male
Re: Delphi COM SendWAVE
Reply #5 - 31. Aug 2007 at 22:05
Print Post  
I've added it in the current beta version!
  
Back to top
WWW  
IP Logged
 
norcis
YaBB Newbies
*
Offline


Phoner ist großartig!

Posts: 11
Joined: 30. Aug 2007
Re: Delphi COM SendWAVE
Reply #6 - 01. Sep 2007 at 09:04
Print Post  
Thank you.

Sometimes I get "wave-file not opened" error and sometimes it plays ok (for the same wav file).


10:01:12,765: Connect B3 Indication
10:01:12,765: Connect B3 Response: accept call
10:01:12,765: Connect B3 Active Indication
10:01:12,765: Connect B3 Active Response
10:01:12,781: Status: B3 connected
10:01:12,781: COM: OnChangeState(0x0101) -> B3Connected
10:01:12,781: COM: GetCallInfo(0x0101)
10:01:12,781: COM: SendWAVE(0x0101, C:\LoopyMusic.wav)
10:01:12,781: opening wave-file: C:\LoopyMusic.wav
10:01:12,796: wave-file not opened
  
Back to top
 
IP Logged
 
Phoner Admin
YaBB Administrator
*****
Offline



Posts: 11778
Location: Germany
Joined: 12. Oct 2003
Gender: Male
Re: Delphi COM SendWAVE
Reply #7 - 04. Sep 2007 at 08:01
Print Post  
I tried the Delphi COM sample and had no problems sending a WAVE file. Do you have a small version of your application that you can send me? The binary file is enough - I just want to test it here at my PC with my instance of Phoner.
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint