Ticket #5705 (new Bugs)

Opened 1 year ago

Last modified 1 year ago

Camp-on settings not being applied correctly, result campon does not work

Reported by: TSM Assigned to: p_lindheimer
Priority: major Milestone: 2.11
Component: Core - Users/Devices Version: 2.10-branch
Keywords: campon Cc:
Confirmation: Unreviewed Distro:
Backend Engine: Asterisk 1.8 Distro Ver:
Backend Ver: SVN Revision (if applicable):

Description

Problem where unless all the correct settings are applied for each extension then camp-on does not work. Old code would add all defaults into ASTDB if you added new extension but not on edit and thus on upgrade.

Ive modified the code here to work with defaults on each extension, its nearly finished but will allow all extens to be set to default and then as callflow is processed it will detect this and setup accordingly, ive also put a double check in there incase no entries exist for the extn, this is then considered a default unless otherwise specified.

This now works fairly well.

Finalized version will allow user to disable system defaults and decide on a per exten basis if they want to use system defaults or extn specific.

29c29
<     $ext->splice('macro-user-callerid', 's', $priority,new ext_gosubif('$[${LEN(${DB(AMPUSER/${AMPUSER}/ccss/cc_agent_policy)})} & "${DB(AMPUSER/${AMPUSER}/ccss/cc_agent_policy)}" != "never"]', 'sub-ccss,s,1',false,'${MACRO_CONTEXT},${CALLERID(dnid)}'));
---
>     $ext->splice('macro-user-callerid', 's', $priority,new ext_gosubif('$["${DB(AMPUSER/${AMPUSER}/ccss/cc_agent_policy)}" != "never" || ${LEN(${DB(AMPUSER/${AMPUSER}/ccss/cc_agent_policy)})}==0]','sub-ccss,s,1',false,'${MACRO_CONTEXT},${CALLERID(dnid)}'));
76a77,78
>
>       $ext->add($mcontext,$exten,'', new ext_noop('AMPUSER: ${AMPUSER} Calling ${ARG2}:${ARG1}'));
78,79c80,81
<       $ext->add($mcontext,$exten,'monitor', new ext_gosubif('$[${LEN(${DB(AMPUSER/${ARG2}/ccss/cc_monitor_policy)})}]','monitor_config,1','monitor_default,1','${ARG1},${ARG2}','${ARG1},${ARG2}'));
<       $ext->add($mcontext,$exten,'agent', new ext_gosubif('$[${LEN(${DB(AMPUSER/${AMPUSER}/ccss/cc_agent_policy)})}]','agent_config,1','agent_default,1'));
---
>       $ext->add($mcontext,$exten,'monitor', new ext_gosubif('$[${LEN(DB(AMPUSER/${ARG2}/ccss/cc_monitor_policy))}==0 || "${DB(AMPUSER/${ARG2}/ccss/cc_monitor_policy)}" == "default"]','monitor_default,1','monitor_config,1','${ARG1},${ARG2}','${ARG1},${ARG2}'));
>       $ext->add($mcontext,$exten,'agent', new ext_gosubif('$[${LEN(DB(AMPUSER/${AMPUSER}/ccss/cc_agent_policy))}==0 || "${DB(AMPUSER/${AMPUSER}/ccss/cc_agent_policy)}" == "default"]','agent_default,1','agent_config,1'));
335a338
>       $currentcomponent->addoptlistitem('cc_agent_policy', 'default', _('Use System Defaults'));
396a400
>       $currentcomponent->addoptlistitem('cc_monitor_policy', 'default', _('Use System Defaults'));
538a543
>   $ccss['cc_monitor_policy'] =    isset($_REQUEST['cc_monitor_policy']) ? $_REQUEST['cc_monitor_policy'] : $amp_conf['CC_MONITOR_POLICY_DEFAULT'];
541c546
<   if ($action == 'add' || $action == 'edit' && !$amp_conf['CC_FORCE_DEFAULTS']) {
---
>   if (($action == 'add' || $action == 'edit') && !$amp_conf['CC_FORCE_DEFAULTS']) {
547d551
<     $ccss['cc_monitor_policy'] =    isset($_REQUEST['cc_monitor_policy']) ? $_REQUEST['cc_monitor_policy'] : $amp_conf['CC_MONITOR_POLICY_DEFAULT'];
576c580
<     $ccss['cc_agent_policy'] = $cc_agent_policy ? $cc_agent_policy : $amp_conf['CC_AGENT_POLICY_DEFAULT'];
---
>     $ccss['cc_agent_policy'] = $cc_agent_policy ? $cc_agent_policy : 'default';
578c582
<     $ccss['cc_monitor_policy'] = $cc_monitor_policy ? $cc_monitor_policy : $amp_conf['CC_MONITOR_POLICY_DEFAULT'];
---
>     $ccss['cc_monitor_policy'] = $cc_monitor_policy ? $cc_monitor_policy : 'default';

Attachments

freepbx_campon_patch1_20120322.diff (6.2 kB) - added by TSM on 03/22/12 18:13:39.

Change History

03/22/12 18:05:33 changed by p_lindheimer

I tried patching with the above and it does not apply. Can you ether use:

diff -ubB original_file new_file > ccss_changes.patch

or otherwise just make the changes on a working SVN checkout (the best way to do it) and use "svn diff" to generate the file. That will put it in a format that is much more resilient to applying the patch. That way we can see better what is going on with your suggestions.

03/22/12 18:13:39 changed by TSM

  • attachment freepbx_campon_patch1_20120322.diff added.

03/22/12 18:33:30 changed by p_lindheimer

(In [13864]) incorrect logic re #5705

03/22/12 18:37:25 changed by p_lindheimer

(In [13865]) Merged revisions 13864 via svnmerge from http://www.freepbx.org/v2/svn/modules/branches/2.10

........

r13864 | p_lindheimer | 2012-03-22 15:33:29 -0700 (Thu, 22 Mar 2012) | 1 line

incorrect logic re #5705

........

04/14/12 13:49:44 changed by p_lindheimer

(In [13970]) Merged revisions 13855-13856,13858-13859,13861,13864,13866,13868,13897,13899-13901,13903,13906,13908,13910,13912,13919,13931,13933-13935,13937,13939,13941,13945,13947-13950,13952-13953,13955-13956,13959,13961-13962,13964-13965,13967 via svnmerge from http://www.freepbx.org/v2/svn/modules/branches/2.10

........

r13855 | p_lindheimer | 2012-03-19 13:17:22 -0700 (Mon, 19 Mar 2012) | 1 line

closes #5664 get app_confbridge to work on Asterisk 10

........

r13864 | p_lindheimer | 2012-03-22 15:33:29 -0700 (Thu, 22 Mar 2012) | 1 line

incorrect logic re #5705

........

r13900 | p_lindheimer | 2012-03-23 14:27:18 -0700 (Fri, 23 Mar 2012) | 1 line

fixes #5710 bad syntax thanks for the fix TSM

........

r13906 | p_lindheimer | 2012-03-23 15:50:21 -0700 (Fri, 23 Mar 2012) | 1 line

fixes #5714 don't write out any Content-Length headers in sip_notify_additional.conf

........

r13908 | mbrevda | 2012-03-26 10:02:04 -0700 (Mon, 26 Mar 2012) | 1 line

closes #5707, #5315 - backup editing issues

........

r13919 | mbrevda | 2012-03-27 01:36:07 -0700 (Tue, 27 Mar 2012) | 1 line

  • upstream changes

........

r13934 | p_lindheimer | 2012-03-27 11:01:15 -0700 (Tue, 27 Mar 2012) | 1 line

fixes #5734 properly validate new destinations

........

r13948 | mbrevda | 2012-03-31 16:03:09 -0700 (Sat, 31 Mar 2012) | 1 line

re #5750 - ensure function exists before calling

........

r13949 | p_lindheimer | 2012-04-02 16:09:06 -0700 (Mon, 02 Apr 2012) | 1 line

fixes #5752 typo resulting in pin being requested twice

........

r13956 | mbrevda | 2012-04-10 07:44:57 -0700 (Tue, 10 Apr 2012) | 1 line

upstream bug fixes, restart updates for asterisk 1.8