Ticket #3029 (closed Bugs: fixed)

Opened 5 months ago

Last modified 5 months ago

CID Name Prefix only works for ringallv2 when prering is used

Reported by: pwalker Assigned to: p_lindheimer
Priority: minor Milestone: 2.5
Component: Follow Me Version: 2.4.0
Keywords: Cc:
Confirmation: Need testing SVN Revision (if applicable):
Backend Engine: All Backend Engine Version:

Description

The CID Name Prefix is only working for the ringallv2 strategy if prering is used. This seems to be because the simple-dial macro - which is called e.g. when using hunt and prering - overwrites the previously correctly set CID name. (findmefollow 2.4.14.2) Code in extension_addtional.conf :

exten => xxx,n,Set(CALLERID(name)=${CALLERID(name):${LEN(${RGPREFIX})}})
exten => xxx,n,Set(_RGPREFIX=)
exten => xxx,n(REPCID),Noop(CALLERID(name) is ${CALLERID(name)})
exten => xxx,n,Set(_RGPREFIX=(xxx))
exten => xxx,n,Set(CALLERID(name)=${RGPREFIX}${CALLERID(name)})
exten => xxx,n,GotoIf($[$[ "${DB(AMPUSER/xxx/followme/prering)}" = "0" ] | $[ "${DB(AMPUSER/xxx/followme/prering)}" = "" ]] ?skipsimple)
exten => xxx,n,Macro(simple-dial,xxx,${DB(AMPUSER/xxx/followme/prering)})
exten => xxx,n(skipsimple),Set(RecordMethod=Group)
exten => xxx,n,Macro(record-enable,${DB(AMPUSER/xxx/followme/grplist)},${RecordMethod})
exten => xxx,n,Set(RingGroupMethod=hunt)
exten => xxx,n,Set(_FMGRP=xxx)
exten => xxx,n(DIALGRP),GotoIf($[ "${DB(AMPUSER/xxx/followme/grpconf)}" = "ENABLED" ]?doconfirm)
exten => xxx,n,Macro(dial,${DB(AMPUSER/xxx/followme/grptime)},${DIAL_OPTIONS},${DB(AMPUSER/xxx/followme/grplist)})

The line with "exten => xxx,n,Macro(simple-dial, ..." is the "turning point"... Before, the CID name is correct (including the Prefix), after, the Prefix is gone...

I have a fix which saves the CID name and restores it after simple-dial, but I need to test it first.

Attachments

findmefollow.diff (1.3 kB) - added by pwalker on 08/07/08 22:46:28.
Patch (v1) for findmefollow/functions.inc.php

Change History

08/07/08 06:25:41 changed by pwalker

Looking at the 2.5 code, this behaves the same.

(follow-up: ↓ 3 ) 08/07/08 07:26:57 changed by p_lindheimer

  • confirmation changed from Unreviewed to Need testing.

pwalker,
can you try commenting out the call to Macro(user-callerid) in macro-simple-dial that is located in the extensions.conf file:

Index: extensions.conf
===================================================================
--- extensions.conf     (revision 6287)
+++ extensions.conf     (working copy)
@@ -500,7 +500,7 @@
 ; ARGS: $EXTENSION, $RINGTIME
 ;------------------------------------------------------------------------
 [macro-simple-dial]
-exten => s,1,Macro(user-callerid,SKIPTTL) ; already called from follow-me
+;exten => s,1,Macro(user-callerid,SKIPTTL) ; already called from follow-me
 
 ; FROMCONTEXT was in the original macro-exten-vm where this macro was derived from. A
 ; search through all the modules does not come up with any place using this
@@ -508,7 +508,7 @@
 ; that eventually behaves in a certain way as a result of this variable being set
 ; and this macro has to masquerade as exten-vm.
 ;
-exten => s,n,Set(EXTTOCALL=${ARG1})
+exten => s,1,Set(EXTTOCALL=${ARG1})
 exten => s,n,Set(RT=${ARG2})
 exten => s,n,Set(CFUEXT=${DB(CFU/${EXTTOCALL})})
 exten => s,n,Set(CFBEXT=${DB(CFB/${EXTTOCALL})})

I think that is redundant and think it may be the reason. (Although didn't look that carefully).

If that works, I noticed additional redundancy and if you are so inclined, it would be great if you could test it. The recording check in simple dial is redundant if we move up the recording check in the followme and ringgroup generation. So the change for macro-simple-dial would be to comment it out:

Index: extensions.conf
===================================================================
--- extensions.conf     (revision 6287)
+++ extensions.conf     (working copy)
@@ -500,7 +500,7 @@
 ; ARGS: $EXTENSION, $RINGTIME
 ;------------------------------------------------------------------------
 [macro-simple-dial]
-exten => s,1,Macro(user-callerid,SKIPTTL) ; already called from follow-me
+;exten => s,1,Macro(user-callerid,SKIPTTL) ; already called from follow-me
 
 ; FROMCONTEXT was in the original macro-exten-vm where this macro was derived from. A
 ; search through all the modules does not come up with any place using this
@@ -508,11 +508,11 @@
 ; that eventually behaves in a certain way as a result of this variable being set
 ; and this macro has to masquerade as exten-vm.
 ;
-exten => s,n,Set(EXTTOCALL=${ARG1})
+exten => s,1,Set(EXTTOCALL=${ARG1})
 exten => s,n,Set(RT=${ARG2})
 exten => s,n,Set(CFUEXT=${DB(CFU/${EXTTOCALL})})
 exten => s,n,Set(CFBEXT=${DB(CFB/${EXTTOCALL})})
-exten => s,n,Macro(record-enable,${EXTTOCALL},IN)
+;exten => s,n,Macro(record-enable,${EXTTOCALL},IN)
 
 exten => s,n,Macro(dial,${RT},${DIAL_OPTIONS},${EXTTOCALL})

and then in the code you have above, make it look like this:

exten => xxx,n,Set(CALLERID(name)=${CALLERID(name):${LEN(${RGPREFIX})}})
exten => xxx,n,Set(_RGPREFIX=)
exten => xxx,n(REPCID),Noop(CALLERID(name) is ${CALLERID(name)})
exten => xxx,n,Set(_RGPREFIX=(xxx))
exten => xxx,n,Set(CALLERID(name)=${RGPREFIX}${CALLERID(name)})
exten => xxx,n,Set(RecordMethod=Group)
exten => xxx,n,Macro(record-enable,${DB(AMPUSER/xxx/followme/grplist)},${RecordMethod})
exten => xxx,n,GotoIf($[$[ "${DB(AMPUSER/xxx/followme/prering)}" = "0" ] | $[ "${DB(AMPUSER/xxx/followme/prering)}" = "" ]] ?skipsimple)
exten => xxx,n,Macro(simple-dial,xxx,${DB(AMPUSER/xxx/followme/prering)})
exten => xxx,n(skipsimple),Set(RingGroupMethod=hunt)
exten => xxx,n,Set(_FMGRP=xxx)
exten => xxx,n(DIALGRP),GotoIf($[ "${DB(AMPUSER/xxx/followme/grpconf)}" = "ENABLED" ]?doconfirm)
exten => xxx,n,Macro(dial,${DB(AMPUSER/xxx/followme/grptime)},${DIAL_OPTIONS},${DB(AMPUSER/xxx/followme/grplist)})

which can be auto generated if you modify functions.inc.php in findmefollow as follows:

Index: functions.inc.php
===================================================================
--- functions.inc.php (revision 6287)
+++ functions.inc.php (working copy)
@@ -81,6 +81,9 @@
            $ext->add($contextname, $grpnum, '', new ext_setvar('_RGPREFIX', $grppre));
            $ext->add($contextname, $grpnum, '', new ext_setvar('CALLERID(name)','${RGPREFIX}${CALLERID(name)}'));
          }
+         // recording stuff
+         $ext->add($contextname, $grpnum, '', new ext_setvar('RecordMethod','Group'));
+         $ext->add($contextname, $grpnum, '', new ext_macro('record-enable','${DB(AMPUSER/'."$grpnum/followme/grplist)}".',${RecordMethod}'));

          // MODIFIED (PL)
          // Add Alert Info if set but don't override and already set value (could be from ringgroup, directdid, etc.)
@@ -98,12 +101,8 @@
            $ext->add($contextname, $grpnum, '', new ext_macro('simple-dial',$grpnum.',${DB(AMPUSER/'."$grpnum/followme/prering)}"));
          }

-         // recording stuff
-         $ext->add($contextname, $grpnum, 'skipsimple', new ext_setvar('RecordMethod','Group'));
-         $ext->add($contextname, $grpnum, '', new ext_macro('record-enable','${DB(AMPUSER/'."$grpnum/followme/grplist)}".',${RecordMethod}'));
-
          // group dial
-         $ext->add($contextname, $grpnum, '', new ext_setvar('RingGroupMethod',$strategy));
+         $ext->add($contextname, $grpnum, 'skipsimple', new ext_setvar('RingGroupMethod',$strategy));
          $ext->add($contextname, $grpnum, '', new ext_setvar('_FMGRP',$grpnum));
          if ((isset($annmsg) ? $annmsg : '') != '') {
            // should always answer before playing anything, shouldn't we ?

Once you do that, you should test by setting record inbound always for the extensions and then call it and make sure it is recording. (you should be able to determine from the CLI trace). Thanks in advance if you could test this and provide feedback. All the above patches are for 2.4 so should apply.

(in reply to: ↑ 2 ) 08/07/08 22:45:04 changed by pwalker

Philippe,
I'll see what I can do and I'll try to test your changes today.

can you try commenting out the call to Macro(user-callerid) in macro-simple-dial that is located in the extensions.conf file: I think that is redundant and think it may be the reason. (Although didn't look that carefully).

I was afraid that I'll break something somewhere else when I change macro-simple-dial, so I decided to try it in a different manner:
I save CALLERID(name) to (temporary) var CALLERID_NEXT before doing simple-dial and read CALLERID_NEXT back into CALLERID(name) before the next dial. See attached patch.
This is a bit "hacky", but it has one (small?) advantage:
In my opinion, the CID prefix should not be set when calling the initial (or more precisely the original number), but only those which follow after the initial one.
Philipp

08/07/08 22:46:28 changed by pwalker

  • attachment findmefollow.diff added.

Patch (v1) for findmefollow/functions.inc.php

08/08/08 05:16:10 changed by p_lindheimer

pwalker,
can you try the patch I provided. Findmefollow is the only application that uses simple-dial so there is not issue there. And the prefix should always be applied if specified since that is how it currently works and it would break legacy behavior, and there are scenarios where this would be the desired behavior.
Thanks in advance for trying it and letting me know, and if you have a chance the recording change would be great to try as well.

08/10/08 11:28:39 changed by p_lindheimer

I can't reproduce your issue with ringallv2 strategy, only with ringall strategy. I've also tested taking out the macro-user-callerid call and that fixes the problem. Furthermore, I have tested taking out the redundant recording check and putting in the single group recording check and it seems to trigger MixMonitor? fine so I'll make that change also. I'm putting this all into 2.5 only, since it is core enough to warrant additional testing before considering putting it into 2.4.

08/10/08 11:32:04 changed by p_lindheimer

  • status changed from new to closed.
  • resolution set to fixed.

(In [6318]) fixes #3029 remove call to macro-user-callerid from macro-simple-dial, also removes extra call to recordingcheck agi script which helps performance