Working SMS Integration

It was a BDR DDL issue replication causing this database lock. Somehow this was the reason the table could not be created. I dont think this a possiblitity regarding standalone install. What is the PostgreSql version running in your system? Mine is 9.4.
Hello Edson,

I am using version 9.6.5 . Maybe I have some bug elsewhere. I am going to attempt a fresh install to see if that does better.
 
I'll just put this out there for those of you attempting to use this module:
I alluded to an issue in the original post, where on some softphone clients it would duplicate the message 120+ times. It will then usually crash/freeze the freeswitch process. It turns out, this was not a problem with the softphone client. It is a problem with Freeswitch. And apparently, not even with the SMS module itself. This bug report indicates that it is an issue with the underlying handler. In spite of the lack of any apparent definite resolution to that bug report, we have only replicated the problem under 1.6.x versions of Freeswitch and not 1.8.x, so it looks like the problem has been fixed. I believe @MTR has also experienced similar results.

Unfortunately, our production systems are currently running 1.6.x, so we have had to disable the module while prepping a transition. There are some complicating factors that make this transition difficult, which I won't go into.

Suffice it to say that I strongly recommend that if you are considering using this module, make sure that you on Freeswitch 1.8.
Here's a follow-up: We've now rolled out upgrades on our servers to Freeswitch 1.8. While we are not seeing the crash/freeze in the Freeswitch process as mentioned previously, we are still seeing the duplicated messages (120+) when the message is sent to an invalid or unregistered extension. We have had to disable local sends to avoid this, because we are now running down another possible memory corruption problem that we suspect is deriving from this. This means no on-net, ext-to-ext chatting. If you are using a version of my chatplan, above, the relevant part now looks like this:
XML:
                <extension name="other">
                        <condition field="to" expression="^(.*)$">
                                <action application="set" data="final_delivery=true"/>
                                <!-- <action application="send"/> -->
                        </condition>
                </extension>
Ideally, the lua script would handle both sends, and would have a way to check to see if the extension is registered before attempting the send. That would be an ideal upgrade.
 
It looks like something is wrong in the \sms\app_config.php file. It's looking for two tables named "v", not finding them, and trying to create them. Instead, it should be looking for "v_sms_messages" and "v_sms_destinations". There may be updates to the 4.4 schema upgrade engine. I've tweaked a couple of settings in the attached. Give this a try and see how it works.
I just did a fresh install of Debian 9 and 4.4 and set up this just following this. https://github.com/fusionpbx/fusionpbx-apps/tree/master/sms and I was unable to add the APP / SMS destination so I found your app_config.php a few posts above and then I changed out what I just downloaded from git. This allowed me to run the upgrade schema and it added the correct tables. I verified this by running the schema upgrade again and nothing was changed. I was then able to add my sms destination.

Can you take the time to update the git repo with this file and also make a note that this shouldn't be used with freeswitch 1.6. If this would have worked out of the box and I didn't go searching I would have possibly crashed my production system due to the bug that you posted that causes high cpu usage.
 
I just did a fresh install of Debian 9 and 4.4 and set up this just following this. https://github.com/fusionpbx/fusionpbx-apps/tree/master/sms and I was unable to add the APP / SMS destination so I found your app_config.php a few posts above and then I changed out what I just downloaded from git. This allowed me to run the upgrade schema and it added the correct tables. I verified this by running the schema upgrade again and nothing was changed. I was then able to add my sms destination.

Can you take the time to update the git repo with this file and also make a note that this shouldn't be used with freeswitch 1.6. If this would have worked out of the box and I didn't go searching I would have possibly crashed my production system due to the bug that you posted that causes high cpu usage.
The data table error you quoted may be a bit of a red herring, though once @yukon gets this all updated, I think the point will be moot. The original error I was addressing turned out to be not fixed by that app_config.php file change, but rather an issue on the poster's system related to BDR locking.

Regarding compatibility with Freeswitch 1.6, please note the following:
  • In my testing, this will work fine with FS 1.6, provided you are only using it with a single server. I've only replicated the problem with servers set up in a cluster of two or more.
  • In that original bug report on the Freeswitch site, the problem occurred independently of this SMS app (I don't believe it even mentioned FusionPBX). This is a bug in Freeswitch 1.6 related to having two servers in a cluster, and can be triggered without even using this app, though it is less likely to be triggered without this app or at least the Freeswitch SMS module active.
That said, @yukon, it's probably a good idea to add a caution about this to the read-me on this app when you do the update to github.