[Freeswitch-users] I need to Inject some string when sending an SMS via chat command to avoid a concurrency problem

Steven Ayre steveayre at gmail.com
Fri Feb 1 17:42:43 MSK 2013


You could try blocking receiving events during the DB update, or if you
cannot do that try storing the BACKGROUND_JOB event in a hash in memory so
that when the record creation succeeds it checks the hash to see if the
event has already been received. You can also use a hash to see if the
record is currently being inserted or not to save checking if it's in the
database.

-Steve



On 1 February 2013 11:42, Leonardo N. S. Pereira
<leonardo at daitangroup.com>wrote:

> I'm sending the SMS via mod_socket interface using the following command:
>      bgapi chat sip|+17778882233|external/+17778882234 at sms-proxy.com|SMS
> test
> The SMS is sent successfully.
> The problem is that I need to inject an string to be retrieved when the
> BACKGROUND_JOB event is received.
>
> This is the scenario:
> #1 Send an SMS using BGAPI
> #2 create a new record in database using the JOB_ID as key
> #3 As soon as the BACKGROUND_JOB event is received, update the database.
>
> The problem is that sometimes, the event is received before the record
> has being created.
>
>
> Is there any way to inject an kind of "trakcing_id" when sending an SMS
> that will be received in BG event? (just in case, for calls I had the
> same problem, and I used the parameter 'origination_channel_name' to
> handle the problem)
>
> Thanks in advance.
> Leo
>
>
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> 
> 
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20130201/babe4070/attachment-0001.html 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list