diff options
-rw-r--r-- | misc/freeswitch/scripts/dialplan/presence.lua | 1 | ||||
-rw-r--r-- | misc/freeswitch/scripts/event/presence_update.lua | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/misc/freeswitch/scripts/dialplan/presence.lua b/misc/freeswitch/scripts/dialplan/presence.lua index 0f63ce9..af05756 100644 --- a/misc/freeswitch/scripts/dialplan/presence.lua +++ b/misc/freeswitch/scripts/dialplan/presence.lua @@ -53,6 +53,7 @@ function Presence.set(self, state, caller_number) event:addHeader('presence-call-direction', direction); event:addHeader('answer-state', state); event:addHeader('unique-id', self.uuid); + event:addHeader('event_origin', 'gemeinschaft'); if caller_number then if self.inbound then event:addHeader('Caller-Destination-Number', caller_number); diff --git a/misc/freeswitch/scripts/event/presence_update.lua b/misc/freeswitch/scripts/event/presence_update.lua index cf29ca9..24b19d5 100644 --- a/misc/freeswitch/scripts/event/presence_update.lua +++ b/misc/freeswitch/scripts/event/presence_update.lua @@ -128,7 +128,9 @@ function PresenceUpdate.presence_in(self, event) direction = false; end - if protocol == 'conf' then + if tostring(event:getHeader('event_origin')) == 'gemeinschaft' then + self.log:debug('[', uuid,'] PRESENCE_', call_direction:upper(),'_LOOP ignored - protocol: ', protocol, ', account: ', account, ', state: ', state); + elseif protocol == 'conf' then state = event:getHeader('answer-state'); local login = tostring(event:getHeader('proto')); self.log:info('[', uuid,'] PRESENCE_CONFERENCE_', call_direction:upper(), ' ', common.str.to_i(account), ' - identifier: ', account, ', state: ', state); |