mandreetta Posted August 11, 2015 #1 Share Posted August 11, 2015 Good Mornig.I'd like to execute an external program when I receive a call and SwyxIt is open and I answer the call.I have tryied to creare a Roule in call routing but it cannot execute.I have create a This VB code in Start Roule:+++Sub CallExternal()dim objShellset objShell = CreateObject("shell.application")objShell.ShellExecute "notepad.exe", "", "", "open", 1set objShell = nothingend sub+++after I have add a Set Variable that call CallExternal I have connect StartRule with Set Variable and Set Variable with Skip Rule. When I receive a call, nothign appear and the phone ring without error. Doing this, i have create a server side rule?It is a correct way to execute a client side application when I receive a Call? Thank you very much. Max Link to comment Share on other sites More sharing options...
Tom Wellige Posted August 11, 2015 #2 Share Posted August 11, 2015 Hello Max, of course nothing shows up, as the call routing is completely handled on the server, not on the client. If you want to open some window on the client for incoming calls, please have a look into this list of examples: https://www.swyxforum.com/forum/28-client-sdk/ Link to comment Share on other sites More sharing options...
mandreetta Posted August 12, 2015 Author #3 Share Posted August 12, 2015 Thanks Tom.Your link send me to a page "Swyx Forum has been moved!"The links below is is broken for example "VBScript updates text file with caller information (example for event handling)" Is the correct link? Thanks Link to comment Share on other sites More sharing options...
Tom Wellige Posted August 12, 2015 #4 Share Posted August 12, 2015 Yes, it's a link into the archived version of Swyx Forum. In deed, the link you quoted is broken, but it's the only one in the list. I thought of this example actually: "How to open an URL from SwyxIt!" Link to comment Share on other sites More sharing options...
mandreetta Posted August 12, 2015 Author #5 Share Posted August 12, 2015 Today is a problem day form me Excuse me This link "How to open an URL from SwyxIt!" permit to Download screencast: How to make use of OpenURL.vbsThe screen cast is only AUDIO cast, is correct? Link to comment Share on other sites More sharing options...
Tom Wellige Posted August 12, 2015 #6 Share Posted August 12, 2015 That's a quite old video. I just downloaded it as well and also get just the audio. I would guess you need some codec (Div-X) installed. The same explanation from the video is also given in the above given links. Link to comment Share on other sites More sharing options...
mandreetta Posted August 12, 2015 Author #7 Share Posted August 12, 2015 I Understand and it work correct.But I want to execute the command automatically when the person answer the call.In this example, I need to press Swyx button. Link to comment Share on other sites More sharing options...
Tom Wellige Posted August 12, 2015 #8 Share Posted August 12, 2015 There is also an example that pushes caller information into a text file automatically. Take that as a basis for just calling your app. Link to comment Share on other sites More sharing options...
mandreetta Posted August 12, 2015 Author #9 Share Posted August 12, 2015 The Link is broken Link to comment Share on other sites More sharing options...
Tom Wellige Posted August 12, 2015 #10 Share Posted August 12, 2015 Attached you will find the file... Link to comment Share on other sites More sharing options...
mandreetta Posted August 12, 2015 Author #11 Share Posted August 12, 2015 Thanks Tom. I try it Link to comment Share on other sites More sharing options...
mandreetta Posted August 12, 2015 Author #12 Share Posted August 12, 2015 The script is fine and run correctly.Is necessary to have a script in loop forever to catch a call?Is correct? Link to comment Share on other sites More sharing options...
Tom Wellige Posted August 12, 2015 #13 Share Posted August 12, 2015 Yes, as you see in the script it is in such a loop (of course with the speed break in it) to make sure to be running all the time to catch all events. Just start it along with the SwyxIt! Link to comment Share on other sites More sharing options...
mandreetta Posted August 12, 2015 Author #14 Share Posted August 12, 2015 Wher I run the first time the script, the event handler run always.I try to kill pressing ctrl-c but if I change the script, the event handler is what I run the first time.Is there a method to kil it? Link to comment Share on other sites More sharing options...
mandreetta Posted September 1, 2015 Author #15 Share Posted September 1, 2015 Hello Tom.I'm trying to modify the script to execute a custom program of mine.I understand than in the event clmgr_DispOnLineMgrNotification with this message: if msg = PubCLMgrLineStateChangedMessageEx theni have to save the parameter DispPeerNumber, DispPeerName etc. and when I receive anothe type of message I have to call my program.I truied to use msg = 4 but when I receive a call, automatically start Swyx Client and after call is closed, my program will start. I correct my method?Can you help me to understand? I omitted that I want to execute a program when a person answare the call not only when the phone ringing. Thank max. Link to comment Share on other sites More sharing options...
Tom Wellige Posted September 1, 2015 #16 Share Posted September 1, 2015 As I see it the only thing you need to change in the above linked script is the function that is called on an incoming call, i.e. the WriteCallDetails function. Replace it with a function that calls your external program and it should work. If you are only interested in new incoming calls and no line state changes (like a call has been transferred or disconnected) you can omit the first "if" condition (if msg = PubCLMgrLineDetailsChangedMessage then) and only use the second one, as that one only responses to an alerting. Link to comment Share on other sites More sharing options...
mandreetta Posted September 2, 2015 Author #17 Share Posted September 2, 2015 Hello Tom.I Just edit the WriteCallDetails calling my external program and it work fine.But if I use only the second IF (if msg = PubCLMgrLineStateChangedMessageEx then) the event WriteCallDetails raise when the phone ring.I want to call this event only when the person Answare, non just when the phone ring. Excuse me for my English Link to comment Share on other sites More sharing options...
Tom Wellige Posted September 2, 2015 #18 Share Posted September 2, 2015 If you also want to respond to answering the call you just have to add an additional condition.All possible line states are defined at the top of the file. if (lState(lineIdx) = PubLSHookOffExternal) and (lStateOld(lineIdx)) = PubLSAlerting then WriteCallDetails _ clmgr.DispGetLine(lineIdx).DispPeerName, _ clmgr.DispGetLine(lineIdx).DispPeerNumber, _ clmgr.DispGetLine(lineIdx).DispCalledExtension, _ clmgr.DispGetLine(lineIdx).DispCallID end ifThe already existing condition checks if the line goes from inactive to alerting. The new condition checks if the lines goes from alerting to hook off (external). That should work. Link to comment Share on other sites More sharing options...
mandreetta Posted September 3, 2015 Author #19 Share Posted September 3, 2015 I add the conditione but the PubLSHookOffExternal does not apper in this message. if msg = PubCLMgrLineStateChangedMessageEx thenlineIdx = CInt(param) and 255 lState(lineIdx) = (CInt(param) and &Hff00) / &H100 if (lState(lineIdx) = PubLSHookOffExternal) and (lStateOld(lineIdx)) = PubLSAlerting thenWScript.Echo "Entro XXX" WriteCallDetails _clmgr.DispGetLine(lineIdx).DispPeerName, _clmgr.DispGetLine(lineIdx).DispPeerNumber, _clmgr.DispGetLine(lineIdx).DispCalledExtension, _clmgr.DispGetLine(lineIdx).DispCallIDend if lStateOld(lineIdx) = lState(lineIdx)end if Link to comment Share on other sites More sharing options...
mandreetta Posted September 3, 2015 Author #20 Share Posted September 3, 2015 If I print the message into the event apper that: MSG (: 28; PARAM : 768; STATE: 3; lineIdx: 0MSG (: 28; PARAM : 2048; STATE: 8; lineIdx: 0MSG (: 28; PARAM : 3072; STATE: 12; lineIdx: 0MSG (: 28; PARAM : 0; STATE: 0; lineIdx: 0 Link to comment Share on other sites More sharing options...
mandreetta Posted September 3, 2015 Author #21 Share Posted September 3, 2015 All the states present in the event clmgr_DispOnLineMgrNotification is that:MSG : 9; PARAM : 66;STATE: 0; lineIdx: 66MSG : 2; PARAM : 0;STATE: 0; lineIdx: 0MSG : 0; PARAM : 0;STATE: 0; lineIdx: 0MSG : 28; PARAM : 768;STATE: 3; lineIdx: 0MSG : 35; PARAM : 3072;STATE: 12; lineIdx: 0MSG : 2; PARAM : 0;STATE: 0; lineIdx: 0MSG : 0; PARAM : 0;STATE: 0; lineIdx: 0MSG : 28; PARAM : 2048;STATE: 8; lineIdx: 0MSG : 35; PARAM : 8192;STATE: 32; lineIdx: 0MSG : 9; PARAM : 69;STATE: 0; lineIdx: 69MSG : 9; PARAM : -2;STATE: 0; lineIdx: 254MSG : 2; PARAM : 0;STATE: 0; lineIdx: 0MSG : 0; PARAM : 0;STATE: 0; lineIdx: 0MSG : 28; PARAM : 3072;STATE: 12; lineIdx: 0MSG : 35; PARAM : 12288;STATE: 48; lineIdx: 0MSG : 4; PARAM : 0; STATE: 0; lineIdx: 0MSG : 2; PARAM : 0; STATE: 0; lineIdx: 0MSG : 0; PARAM : 0; STATE: 0; lineIdx: 0MSG : 28; PARAM : 0;STATE: 0; lineIdx: 0MSG : 35; PARAM : 0;STATE: 0; lineIdx: 0MSG : 9; PARAM : 69;STATE: 0; lineIdx: 69MSG : 9; PARAM : -2;STATE: 0; lineIdx: 254MSG : 9; PARAM : 66;STATE: 0; lineIdx: 66MSG : 3; PARAM : 32;STATE: 0; lineIdx: 32 Link to comment Share on other sites More sharing options...
mandreetta Posted September 3, 2015 Author #22 Share Posted September 3, 2015 This is all the parameters:MSG : 9; PARAM : 66;STATE: 0; lineIdx: 66MSG : 2; PARAM : 0;STATE: 0; lineIdx: 0MSG : 0; PARAM : 0;STATE: 0; lineIdx: 0MSG : 28; PARAM : 768;STATE: 3; lineIdx: 0MSG : 35; PARAM : 3072;STATE: 12; lineIdx: 0MSG : 2; PARAM : 0;STATE: 0; lineIdx: 0MSG : 0; PARAM : 0;STATE: 0; lineIdx: 0MSG : 28; PARAM : 2048;STATE: 8; lineIdx: 0MSG : 35; PARAM : 8192;STATE: 32; lineIdx: 0MSG : 9; PARAM : 69;STATE: 0; lineIdx: 69MSG : 9; PARAM : -2;STATE: 0; lineIdx: 254MSG : 2; PARAM : 0;STATE: 0; lineIdx: 0MSG : 0; PARAM : 0;STATE: 0; lineIdx: 0MSG : 28; PARAM : 3072;STATE: 12; lineIdx: 0MSG : 35; PARAM : 12288;STATE: 48; lineIdx: 0MSG : 4; PARAM : 0; STATE: 0; lineIdx: 0MSG : 2; PARAM : 0; STATE: 0; lineIdx: 0MSG : 0; PARAM : 0; STATE: 0; lineIdx: 0MSG : 28; PARAM : 0;STATE: 0; lineIdx: 0MSG : 35; PARAM : 0;STATE: 0; lineIdx: 0MSG : 9; PARAM : 69;STATE: 0; lineIdx: 69MSG : 9; PARAM : -2;STATE: 0; lineIdx: 254MSG : 9; PARAM : 66;STATE: 0; lineIdx: 66MSG : 3; PARAM : 32;STATE: 0; lineIdx: 32 Link to comment Share on other sites More sharing options...
mandreetta Posted September 3, 2015 Author #23 Share Posted September 3, 2015 I have resolved using this states:if (lState(lineIdx) = PubLSActive) and (lStateOld(lineIdx)) = PubLSRinging then Thank's a lot Link to comment Share on other sites More sharing options...
Tom Wellige Posted September 3, 2015 #24 Share Posted September 3, 2015 You're welcome :-) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.