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@daitangroup.com>wrote:
I'm sending the SMS via mod_socket interface using the following command: bgapi chat sip|+17778882233|external/+17778882234@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@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org