Tom Wellige Posted September 3, 2019 #1 Share Posted September 3, 2019 This post is taken from the Swyx Forum Archive (2007-2014) and was originally posted 27.04.2010 by me EDIT 02.2021: beside the following function you might also want to take a look on the -> PBXScript.WebRequest which was added with SwyxWare 12.40 This function calls (launches) a given URL (http request) and returns True if the request returns without error. Please find the LaunchHTTPRequest function in the Function Collection (VBScript) and Function Collection (Lua) area of the Programming References section of the SwyxPEDIA here on Swyx Forum. Link to comment Share on other sites More sharing options...
JakobH Posted January 29, 2020 #2 Share Posted January 29, 2020 Hello Tom, do i have to install anything on my Windows server to use this script? do i have to install this for it to work (https://support.microsoft.com/en-us/help/290761/frequently-asked-questions-about-serverxmlhttp)? Msxml2.ServerXMLHTTP.3.0 because this script wont work on my windows 12 server. Best regards Jakob H Link to comment Share on other sites More sharing options...
Tom Wellige Posted January 31, 2020 Author #3 Share Posted January 31, 2020 Hi Jakob, do you see any error messages in the server trace file? If you need help with the server trace file please have a look here. 1 Link to comment Share on other sites More sharing options...
JakobH Posted February 21, 2020 #4 Share Posted February 21, 2020 Hey Tom, i found the error: On 9/3/2019 at 9:51 PM, Tom Wellige said: ( sURL = '" sURL & "' )" i had to change this to: ( sURL = "+ sURL & +" )" Then i used your code to make an HTTP request to my own C# API to get the number from the on-call duty person with "HTTP_REQ.responseText". Thank you for your awesome work in this forum! With best regards Jakob H Link to comment Share on other sites More sharing options...
Tom Wellige Posted February 24, 2020 Author #5 Share Posted February 24, 2020 Hi Jakob, thanks for the hint. I have fixed the code in the first post. That must have been some strange copy&paste error. Best, Tom. Link to comment Share on other sites More sharing options...
Daniel A Posted April 15, 2020 #6 Share Posted April 15, 2020 Hi there, I would like to call a URL for incoming calls, which should then save the number in a variable. I used your script for this. The number also arrives, but with +49 I would like 0049 instead of +49 is that possible? Link to comment Share on other sites More sharing options...
Tom Wellige Posted April 15, 2020 Author #7 Share Posted April 15, 2020 14 minutes ago, Daniel A said: Hi there, I would like to call a URL for incoming calls, which should then save the number in a variable. I used your script for this. The number also arrives, but with +49 I would like 0049 instead of +49 is that possible? What Client SDK API or SwyxIt! Variable are you using the get the caller number? Link to comment Share on other sites More sharing options...
Daniel A Posted April 15, 2020 #8 Share Posted April 15, 2020 12 minutes ago, Tom Wellige said: Welche Client SDK API oder SwyxIt! Variable verwenden Sie die Anrufernummer abrufen? Hi, thanks for the quick response. I use the "IpPbx.Calling Number" version v12 Stay healthy. Yours sincerely Link to comment Share on other sites More sharing options...
Tom Wellige Posted April 16, 2020 Author #9 Share Posted April 16, 2020 Hi, the function IpPbx.CallingNumber calls PBXCall.CallingPartyNumber which actually should return the caller number not in canonical (+49) but in the wanted format (0049). The only reason I can think of at the moment, that you are getting the number in canonical format, is that you have the caller in the global/private phone book which sets the number internally then in canonical format. Do you have the caller in your global/private phone book? Link to comment Share on other sites More sharing options...
Daniel A Posted April 16, 2020 #10 Share Posted April 16, 2020 1 hour ago, Tom Wellige said: Hallo, Die Funktion IpPbx.CallingNumber ruft PBXCall.CallingPartyNumber auf, die die Anrufernummer eigentlich nicht kanonisch (+49), sondern im gewünschten Format (0049) zurückgeben soll. Der einzige Grund, an den ich im Moment denken kann, dass Sie die Nummer im kanonischen Format erhalten, ist, dass Sie den Anrufer im globalen / privaten Telefonbuch haben, das die Nummer intern und dann im kanonischen Format festlegt. Haben Sie den Anrufer in Ihrem globalen / privaten Telefonbuch? hello, I've tried it again. It always comes with +49 instead of 0049. No is not in the phone book. Is there no way to replace the variable beforehand? Sincerely, Daniel Link to comment Share on other sites More sharing options...
Tom Wellige Posted April 17, 2020 Author #11 Share Posted April 17, 2020 I little bit of VBScript code should do the trick: Dim sCaller sCaller = IpPbx.CallingNumber If Left(sCaller, 1) = "+" Then sCaller = "00" & Right(sCaller, Len(sCaller)-1) End If or Dim sCaller sCaller = Replace(IpPbx.CallingNumber, "+", "00") Afterwards you use "sCaller" in your URL instead of "IpPbx.CallingNumber". Link to comment Share on other sites More sharing options...
Daniel A Posted April 18, 2020 #12 Share Posted April 18, 2020 thank you tom i will be heard Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now