summaryrefslogtreecommitdiff
path: root/misc/freeswitch/scripts/common/sip_account.lua
diff options
context:
space:
mode:
authorPeter Kozak <spag@golwen.net>2013-03-02 02:44:34 -0500
committerPeter Kozak <spag@golwen.net>2013-03-02 02:44:34 -0500
commitecf2b91a0b0538b60fb708a237e10af77afe33dc (patch)
treeab673e440f8a3fd486f0b890ce7f62ad817ce7a8 /misc/freeswitch/scripts/common/sip_account.lua
parentff57c349adcada4392386fc2820f7e0a0fc974aa (diff)
call waiting fixed
Diffstat (limited to 'misc/freeswitch/scripts/common/sip_account.lua')
-rw-r--r--misc/freeswitch/scripts/common/sip_account.lua16
1 files changed, 6 insertions, 10 deletions
diff --git a/misc/freeswitch/scripts/common/sip_account.lua b/misc/freeswitch/scripts/common/sip_account.lua
index 90fa379..6cc7d25 100644
--- a/misc/freeswitch/scripts/common/sip_account.lua
+++ b/misc/freeswitch/scripts/common/sip_account.lua
@@ -129,17 +129,13 @@ function SipAccount.send_text(self, text)
end
-function SipAccount.call_state(self)
- local state = nil
- local sql_query = "SELECT `callstate` FROM `channels` \
- WHERE `name` LIKE (\"\%" .. self.record.auth_name .. "@%\") \
- OR `name` LIKE (\"\%" .. self.record.auth_name .. "@%\") LIMIT 1";
-
- self.database:query(sql_query, function(channel_entry)
- state = channel_entry.callstate;
- end)
+function SipAccount.call_state(self)
+ local sql_query = 'SELECT `callstate` FROM `detailed_calls` \
+ WHERE `presence_id` LIKE "' .. self.record.auth_name .. '@%" \
+ OR `b_presence_id` LIKE "' .. self.record.auth_name .. '@%" \
+ LIMIT 1';
- return state;
+ return self.database:query_return_value(sql_query);
end