Jump to content

Execute External Program


mandreetta

Recommended Posts

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 objShell

set objShell = CreateObject("shell.application")

objShell.ShellExecute "notepad.exe", "", "", "open", 1

set objShell = nothing

end 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

 


post-653-0-23471500-1439305870_thumb.png

Link to comment
Share on other sites


  • 3 weeks later...

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 then


i 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


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


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


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 if


The 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


I add the conditione but the PubLSHookOffExternal does not apper in this message.


 


if msg = PubCLMgrLineStateChangedMessageEx then

lineIdx = CInt(param) and 255

   lState(lineIdx) = (CInt(param) and &Hff00) / &H100

   

if (lState(lineIdx) = PubLSHookOffExternal) and (lStateOld(lineIdx)) = PubLSAlerting then

WScript.Echo "Entro XXX"

 

WriteCallDetails _

clmgr.DispGetLine(lineIdx).DispPeerName, _

clmgr.DispGetLine(lineIdx).DispPeerNumber, _

clmgr.DispGetLine(lineIdx).DispCalledExtension, _

clmgr.DispGetLine(lineIdx).DispCallID

end if

 

lStateOld(lineIdx) = lState(lineIdx)

end if

Link to comment
Share on other sites


All the states present in the event clmgr_DispOnLineMgrNotification is that:



MSG : 9; PARAM : 66;STATE: 0; lineIdx: 66

MSG : 2; PARAM : 0;STATE: 0; lineIdx: 0

MSG : 0; PARAM : 0;STATE: 0; lineIdx: 0

MSG : 28; PARAM : 768;STATE: 3; lineIdx: 0

MSG : 35; PARAM : 3072;STATE: 12; lineIdx: 0

MSG : 2; PARAM : 0;STATE: 0; lineIdx: 0

MSG : 0; PARAM : 0;STATE: 0; lineIdx: 0

MSG : 28; PARAM : 2048;STATE: 8; lineIdx: 0

MSG : 35; PARAM : 8192;STATE: 32; lineIdx: 0

MSG : 9; PARAM : 69;STATE: 0; lineIdx: 69

MSG : 9; PARAM : -2;STATE: 0; lineIdx: 254

MSG : 2; PARAM : 0;STATE: 0; lineIdx: 0

MSG : 0; PARAM : 0;STATE: 0; lineIdx: 0

MSG : 28; PARAM : 3072;STATE: 12; lineIdx: 0

MSG : 35; PARAM : 12288;STATE: 48; lineIdx: 0

MSG : 4; PARAM : 0; STATE: 0; lineIdx: 0

MSG : 2; PARAM : 0; STATE: 0; lineIdx: 0

MSG : 0; PARAM : 0; STATE: 0; lineIdx: 0

MSG : 28; PARAM : 0;STATE: 0; lineIdx: 0

MSG : 35; PARAM : 0;STATE: 0; lineIdx: 0

MSG : 9; PARAM : 69;STATE: 0; lineIdx: 69

MSG : 9; PARAM : -2;STATE: 0; lineIdx: 254

MSG : 9; PARAM : 66;STATE: 0; lineIdx: 66

MSG : 3; PARAM : 32;STATE: 0; lineIdx: 32

Link to comment
Share on other sites


This is all the parameters:

MSG : 9; PARAM : 66;STATE: 0; lineIdx: 66

MSG : 2; PARAM : 0;STATE: 0; lineIdx: 0

MSG : 0; PARAM : 0;STATE: 0; lineIdx: 0

MSG : 28; PARAM : 768;STATE: 3; lineIdx: 0

MSG : 35; PARAM : 3072;STATE: 12; lineIdx: 0

MSG : 2; PARAM : 0;STATE: 0; lineIdx: 0

MSG : 0; PARAM : 0;STATE: 0; lineIdx: 0

MSG : 28; PARAM : 2048;STATE: 8; lineIdx: 0

MSG : 35; PARAM : 8192;STATE: 32; lineIdx: 0

MSG : 9; PARAM : 69;STATE: 0; lineIdx: 69

MSG : 9; PARAM : -2;STATE: 0; lineIdx: 254

MSG : 2; PARAM : 0;STATE: 0; lineIdx: 0

MSG : 0; PARAM : 0;STATE: 0; lineIdx: 0

MSG : 28; PARAM : 3072;STATE: 12; lineIdx: 0

MSG : 35; PARAM : 12288;STATE: 48; lineIdx: 0

MSG : 4; PARAM : 0; STATE: 0; lineIdx: 0

MSG : 2; PARAM : 0; STATE: 0; lineIdx: 0

MSG : 0; PARAM : 0; STATE: 0; lineIdx: 0

MSG : 28; PARAM : 0;STATE: 0; lineIdx: 0

MSG : 35; PARAM : 0;STATE: 0; lineIdx: 0

MSG : 9; PARAM : 69;STATE: 0; lineIdx: 69

MSG : 9; PARAM : -2;STATE: 0; lineIdx: 254

MSG : 9; PARAM : 66;STATE: 0; lineIdx: 66

MSG : 3; PARAM : 32;STATE: 0; lineIdx: 32

Link to comment
Share on other sites


Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and have taken note of our Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.