PureConnect

 View Only


Discussion Thread View
Expand all | Collapse all

SMS and Twilio

  • 1.  SMS and Twilio

    Posted 02-23-2018 18:20
    Hi All, Can anyone using Twilio give me some advice? I had the broker working (I'm on 2016R4) for inbound and outbound, and I got it to work by commenting out the Value name for ExternalDeliveryStatusURI. It didn't like the parameter I was passing, but it would work without it. We did some testing, and all was well. And then I let it sit for awhile as we are not yet using it in production. Today I went to test, and outbound doesn't work. So I reinstated that Value, but it wasn't passing the StatusCallback URL, it was passing the Interaction ID only. I have modified to get it to send successfully, but it still isn't quite right as I'm not sure how it will send the interaction ID as I replaced that with the URL. Not quite right... Has anyone else had to make this modification to the XML file for Twilio? Inbound is working without any issue. Thanks! Nicole


  • 2.  RE: SMS and Twilio

    GENESYS
    Posted 02-26-2018 13:51
    Yes, sometime last year Twilio changed their API, and you have to remove that StatusCallback element. I believe we have at least a few customers that are using Twilio, but the delivery receipt feature no longer works for them, because there is not a way to pass in metadata when a message is sent and have it passed back in the delivery receipt. The delivery receipt feature is built around being able to pass in our interaction ID when a message is sent, and get it back in the delivery receipt so we can map the delivery receipt to the corresponding interaction.


  • 3.  RE: SMS and Twilio

    Posted 02-26-2018 14:46
    Originally posted by TroyT;36770
    Yes, sometime last year Twilio changed their API, and you have to remove that StatusCallback element. I believe we have at least a few customers that are using Twilio, but the delivery receipt feature no longer works for them, because there is not a way to pass in metadata when a message is sent and have it passed back in the delivery receipt. The delivery receipt feature is built around being able to pass in our interaction ID when a message is sent, and get it back in the delivery receipt so we can map the delivery receipt to the corresponding interaction.
    OK. I'll give it another test with it disabled. Thanks! Nicole


  • 4.  RE: SMS and Twilio

    Posted 05-23-2018 09:48
    Edited by Brian Smith 05-23-2018 10:13
    ​I'm having issues with getting Twilio working correctly.  I changed the XML but I don't know that it is taking the changes or not.  Could you post an excerpt of the changes you made to get this working successfully?

    ------------------------------
    Brian Smith
    Incept
    ------------------------------



  • 5.  RE: SMS and Twilio

    Posted 05-23-2018 15:59
    I had the same issue.  When I started testing, it worked fine (Jan 2017).  Then we tabled the project.    I started up again late 2017 and now, when I send a message inbound, I can answer, and respond, but the next inbound in that conversation starts a new chat that then sustains for the duration of the conversation.  I can't figure out how to avoid two conversations getting created from one inbound message.  Just wondering if you are experiencing the same?

    I haven't been able to figure it out.  Hopefully someone posts here because I would like to see the answer as well.

    Thanks!
    Nicole

    ------------------------------
    Nicole Rastall

    ------------------------------



  • 6.  RE: SMS and Twilio

    Posted 05-23-2018 16:22
    ​I'm attempting to just get the initial send to go out.  I have it writing to the SMS tables but I'm not seeing the response get to Twilio.   I believe I have everything configured correctly and in the logs I can see the http response request but it looks like I'm getting a 301 error after that.  I saw this post and tried to comment out some portions of the twilio xml file in the resources folder but I'm not sure that it is actually being used. Any idea what I may be missing?

    Thanks,
    Brian

    ------------------------------
    Brian Smith
    Incept
    ------------------------------



  • 7.  RE: SMS and Twilio

    Posted 05-23-2018 16:50
    I changed this line in the broker file
    <!-- Value name="${ExternalDeliveryStatusURI}?http://sms.rrins.com" element="StatusCallback"/ -->

    However, whether you make that change or not, your message should still get to Twilio.  Other than adding my credentials and commenting that line, I didn't change the xml file.

    I used Postman (Chrome plugin) to test my settings.  That worked well for debugging.

    Is your message terminated tab on the broker configured with the correct outgoing path?  That took a bit to get settled after verifying the settings with Postman.

    Thanks,



    ------------------------------
    Nicole
    ------------------------------



  • 8.  RE: SMS and Twilio

    Posted 05-23-2018 16:53
    Also, if you make changes to the broker, I found bouncing the SMS service was necessary after a few changes.

    Just recalled that bit of info.


    Thanks,

    ------------------------------
    Nicole
    ------------------------------



  • 9.  RE: SMS and Twilio

    Posted 05-24-2018 08:35
    ​This is what I have in the outgoing path: /2010-04-01/Accounts/AC6c7f8dfcb1dd8b7c8e6844cdfc1ac967/Messages


    I did not add any credentials to the xml file as I assumed the broker configuration would pass those along from the accounts tab.  What are you using for the local address?  I added our 10 digit number but I'm not sure whether a leading +1 or 1 is necessary.

    Thanks for your responses so far!

    ------------------------------
    Brian Smith
    Incept
    ------------------------------



  • 10.  RE: SMS and Twilio

    Posted 05-24-2018 10:43
    Hi Brian,
    For our long codes I do have +1 in the Local Address field and have no problems sending out through Twilio.  

    I've also put most of the outgoing path in the Gateway field

    In the outgoing path I have 'Messages.JSON'

    And along with Nicole I've noticed that sometimes changes to the Outbound or Inbound routing, or even broker configs don't take affect unless you bounce the SMS Subsystem.  There have even been times where a regular expression in the outbound routing tab would not commit to the sms config and I had to delete it and add it again.

    ------------------------------
    Jerrod McCracken
    ABC Financial
    ------------------------------



  • 11.  RE: SMS and Twilio

    Posted 05-24-2018 11:05
    ​I didn't need the longer path in the gateway field.  I left is at https://api.twilio.com

    I'm wondering how you handle the statusuridelivery issue?  Maybe because you use JSON and not POST?  If I could resolve this issue, we would be closer to true production testing.  Although, I still think the interface for our customer service team is not very friendly. 


    ------------------------------
    Thanks! Nicole
    ------------------------------



  • 12.  RE: SMS and Twilio

    Posted 05-24-2018 10:59
    Edited by Nicole Rastall 05-24-2018 12:32

          <Command name="Send">
            <Request type="POST">
              <!-- Twilio requires the AccountSid to be specified in the URI     -->
              <!-- path, so customers will have to override this in the IA       -->
              <!-- broker config.  The '__your_accountsid__' value that will     -->
              <!-- appear by default should help make this clear.                -->
              <!-- The account user name must also be set to the AccountSid,     -->
              <!-- even though it's not used here, because it's used by the      -->
              <!-- Basic authentication scheme.  The account password is the     -->
              <!-- AuthToken for the account.                                    -->
              <WebService path="/2010-04-01/Accounts/adkndiwnefin/Messages"/>
              <Authentication scheme="Basic"/>
              <Value name="${Password}"         element="AuthToken"/>
              <Value name="${CallingNumber}"    element="PhoneNumber"/>
              <Value name="${CalledNumber}"     element="To"/>
              <Value name="${CallingNumber}"    element="From"/>
              <Value name="${Message}"          element="Body"/>
              <!-- Twilio doesn't provide any client message ID field to hold    -->
              <!-- the interaction ID.  In order to pass it through to the       -->
              <!-- delivery receipt, include it as a query parameter here.       -->
              <!-- Twilio's own parameters will appear in the request body       -->
              <!-- (since they do a POST), and this parameter will appear in the -->
              <!-- URI path.  i3sms parses both of these for a POST service.     -->
              <!-- Value name="${ExternalDeliveryStatusURI}?url.com" element="StatusCallback"/ -->
       </Request>
          </Command>
        </Commands>
      </Send>

    This is my send portion of the XML - the yellow are the places I customized it.  Under Account tab, I don't have the +1 - just the 10 digit phone number.  It's been so long, I'm not completely certain what I'm using as the password, but the Twilio string is in the field for login.

    I haven't used it in awhile, but I checked outbound yesterday, and I received my test with no problems.

    I hope this helps!

    Let me know if I can provide any more info.

    Thanks, Nicole

    ------------------------------
    Nicole
    ------------------------------



  • 13.  RE: SMS and Twilio

    Posted 05-25-2018 13:01
    I was able to get a message to finally send out.  ​Thanks to both of you for your assistance.  It ended up being the restart of the service that was causing my issues.  I haven't tested out two way texting yet but I'll post back here my findings to see if I can provide some assistance to those issues.

    ------------------------------
    Brian Smith
    Incept
    ------------------------------



Need Help finding something?

Check out the Genesys Knowledge Network - your all-in-one access point for Genesys resources