06-14-2020 08:36 AM - edited 06-14-2020 09:22 AM
Hi Experts,
Just want to ask for any ad vises. I'm trying to build a script wherein the Caller will choose Option 4 (for example), then it will send the Caller ID via XML / HTTP to the SMS gateway server. Can you please tell me how to achieve this or what function can I use? Any help will be appreciated. Thank you.
Regards,
Flo
06-14-2020 01:21 PM
I think this is a question to feature set of SMS Gateway
06-14-2020 01:43 PM
As @Konstantin Vaksin has already mentioned this is the matter of the SMS gateway that you will use. Before you make any scripting, you will need to do some discovery how you SMS gateway can be controlled. Some of the SMS Gateways are using SMPP protocol (https://smpp.org/), some have a custom protocol (ex. Twilio, Telnyx) – but you can find good documents on the net to see the description of the protocol (sometimes even SDK).
Based on the options I think that you will have at least 2 options:
Which method will be good for you, that depends on the SMS gateway type.
06-14-2020 02:04 PM
06-14-2020 07:17 PM
You may not be interested but maybe others might? I have done this very easily but I already had my CentOS7 Linux box with PHP built for all my regular IVR query's. First, I bought a phone number from "Twilio", its super cheap. Then I downloaded the "twilio-php-master" zip file from GitHub. Then I just uncompressed it in my www folder on my Linux box where all my PHP scripts sit. Then I built a PHP script that is exactly this below and I have that in the same www folder that the twilio files and my other PHP scripts are on my Linux box. Then in my UCCX script when I want it to like take someones keyed in cellphone number and text them, I accept their inputted number and hold it in variable 'number1'. I have in the UCCX script already made messages in other variables, like variable "message1". So in UCCX I then build a webcall to call to my PHP Linux box with those 2 variables in it and the complete webcall looks like http://10.10.100.5/uccxSMSout.php?&NumberOut=number1&TextOut=message1 The webcall in UCCX is executed by the Create URL Document followed by the Cache Document step (thanks to Anthony Holloway on here). So that will get everything over to my PHP Linux box and PHP and Apache on there will intertwine with the Twilio library on there and send it all to Twilio and Twilio will extract the phone number and message and send the text. One thing I had to overcome (and the UCCX would error out on the Cache Document step) is that PHP doesn't like the spaces in the actual text messages you would have previously typed into variables into UCCX, so I had to use the UCCX string find and replace, to find spaces and replace them with "%20" for each space between words in your previously typed outbound text messages or, if you were to concatenate words for an outbound text message on the fly you still need the %20 in there between the words, like "I want to get out of here", so the UCCX SET command would make that "I%20want%20to%20get%20out%20of%20here" Believe me, it comes out correct on the persons cell phone screen.
<?php
require __DIR__ . '/twilio-php-master/src/Twilio/autoload.php';
use Twilio\Rest\Client;
// Your Account SID and Auth Token from twilio.com/console
$nbr = $_REQUEST['NumberOut']; $txt1 = $_REQUEST['TextOut'];
$account_sid = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
$auth_token = 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy';
// A Twilio number you own with SMS capabilities
$twilio_number = "+18082223333";
$client = new Client($account_sid, $auth_token);
$client->messages->create(
$nbr,
array(
'from' => $twilio_number,
'body' => $txt1
)
);
06-14-2020 09:33 PM
@nanosynth thanks for sharing :) +5
06-15-2020 09:13 AM
Thanks all for your advises. Really appreciated.
I am using "Make REST Call" and everything is good if I will just put a static number (MobileNo) however I am having issue adding the MobileNo variable to the string variable. Is there a way to call the MobileNo variable inside a string? I would like to add it below, for example:
"<SMS><Mobile>MobileNo</Mobile><Message>Test Message</Message></SMS>"
Or is there a way to convert a Document File as a String? Thanks in advance.
06-15-2020 09:31 AM
I have never used the REST call step, but Im interested. Anyway can you can share your code on how you used it? Who are you using to actually send the text to the phone number you provide and the text message? I'm not quite sure what your asking but if you want to do 'concatenation' of a standard string variable, then you have to use the SET step. SET the main variable that will hold all the concatenation to something like this, PhoneNumberEntered + TextOut + TextMsgOut Those 3 things are all preset variables. I actually did this SET step with the main variable being a DOC variable, so the DOC will then contain all the things you want to stuff into it.
06-15-2020 09:36 AM
Forgot to tell you, then in the SET step right after that, I then SET a main real variable (not a DOC variable) to be = to "" + SMSurl + smsItemsDOC which then takes what I just put in the DOC from the above SET STEP and concatenates it with my web URL variable, then puts all that into a regular string variable for the CREATE URL document to process (or whatever you want).
06-15-2020 11:55 PM - edited 06-16-2020 11:13 AM
Thanks for all your replies. Was able to achieve it by concatenating the string values. Stay safe!
06-16-2020 11:34 AM
Any chance you can actually share what you did with the REST step and SMS? I have never used the REST step and always wondered what I can use it for.
06-21-2020 11:57 AM
10-21-2020 09:45 AM
Flo,
What you describe sounds similar to a Visual IVR. We provide a Chat solution that allows you to send messages over any chat platform (amongst which SMS and Whatsapp), either from an IVR or as part of an agent chat solution. Customer Data such as the Caller ID is stored in Customer Interaction Manager that is part of the solution.
This is maybe a bit more than what you're searching for, but might be helpful if you plan to extend the solution.
Regards,
Andreas
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide