Account for bridge variables and more advanced agent contact string.
If using the { and } with the contact string it would add an extra } bracket. The following changes remove the extra bracket and account for more of the bridge variables.
This commit is contained in:
+11
-8
@@ -206,24 +206,27 @@
|
|||||||
if (string.find(agent_contact, 'call_timeout') == nil) then
|
if (string.find(agent_contact, 'call_timeout') == nil) then
|
||||||
--add the call_timeout
|
--add the call_timeout
|
||||||
pos = string.find(agent_contact, "}");
|
pos = string.find(agent_contact, "}");
|
||||||
first = string.sub(agent_contact, 0, pos);
|
first = string.sub(agent_contact, 0, pos -1);
|
||||||
|
last = string.sub(agent_contact, pos);
|
||||||
|
agent_contact = first..[[,domain_name=]]..domain_name..[[,domain_uuid=]]..domain_uuid..[[,sip_h_caller_destination=${caller_destination},call_timeout=]]..agent_call_timeout..last;
|
||||||
|
else
|
||||||
|
--add the call_timeout
|
||||||
|
pos = string.find(agent_contact, "}");
|
||||||
|
first = string.sub(agent_contact, 0, pos - 1);
|
||||||
last = string.sub(agent_contact, pos);
|
last = string.sub(agent_contact, pos);
|
||||||
agent_contact = first..[[,sip_h_caller_destination=${caller_destination},call_timeout=]]..agent_call_timeout..last;
|
agent_contact = first..[[,sip_h_caller_destination=${caller_destination},call_timeout=]]..agent_call_timeout..last;
|
||||||
else
|
|
||||||
--the string has the call timeout
|
|
||||||
agent_contact = agent_contact;
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
--found
|
--found
|
||||||
pos = string.find(agent_contact, "}");
|
pos = string.find(agent_contact, "}");
|
||||||
first = string.sub(agent_contact, 0, pos);
|
first = string.sub(agent_contact, 0, pos - 1);
|
||||||
last = string.sub(agent_contact, pos);
|
last = string.sub(agent_contact, pos);
|
||||||
if (string.find(agent_contact, 'call_timeout') == nil) then
|
if (string.find(agent_contact, 'call_timeout') == nil) then
|
||||||
--add the call_timeout and confirm
|
--add the call_timeout and confirm
|
||||||
agent_contact = first..','..confirm..',sip_h_caller_destination=${caller_destination},call_timeout='..agent_call_timeout..last;
|
agent_contact = first..','..confirm..',sip_h_caller_destination=${caller_destination},domain_name="..domain_name..",domain_uuid="..domain_uuid..",sip_h_caller_destination=${caller_destination},call_timeout='..agent_call_timeout..last;
|
||||||
else
|
else
|
||||||
--add confirm
|
--add confirm
|
||||||
agent_contact = tmp_first..',sip_h_caller_destination=${caller_destination},'..confirm..tmp_last;
|
agent_contact = tmp_first..',domain_name="..domain_name..",domain_uuid="..domain_uuid..",sip_h_caller_destination=${caller_destination},'..confirm..tmp_last;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user