Ticket #3345 (closed Bugs: fixed)

Opened 5 years ago

Last modified 5 years ago

CID only based routing fails when DID is 's'

Reported by: p_lindheimer Assigned to: p_lindheimer
Priority: minor Milestone: 2.6
Component: Core Version: 2.5-branch
Keywords: Cc:
Confirmation: Need testing Distro:
Backend Engine: All Distro Ver:
Backend Ver: SVN Revision (if applicable):

Description

because of the change from 's' to '_.' used in CID only based routing, if your provider, gateway device or zap card is sending a call to the s extension with valid CID information, it does not get routed.

See: http://freepbx.org/forum/freepbx/users/cid-based-inbound-routing-problem

Attachments

extdid.patch (1.8 kB) - added by p_lindheimer on 10/29/08 12:35:47.
blacklist.patch (480 bytes) - added by p_lindheimer on 10/29/08 12:36:16.
cidlookup.patch (485 bytes) - added by p_lindheimer on 10/29/08 12:36:38.

Change History

10/28/08 19:22:07 changed by p_lindheimer

  • confirmation changed from Confirmed to Need testing.

proposed change to core's functions.inc.php

Index: functions.inc.php
===================================================================
--- functions.inc.php (revision 7124)
+++ functions.inc.php (working copy)
@@ -885,9 +885,11 @@
          // but we don't want to limit this to just numberic as someone may be trying to
          // route a non-numeric did
          //
+         $cidroute = false;
          if ($cidnum != '' && $exten == '') {
            $exten = '_.';
            $pricid = ($item['pricid']) ? true:false;
+           $cidroute = true;
          } else if (($cidnum != '' && $exten != '') || ($cidnum == '' && $exten == '')) {
            $pricid = true;
          } else {
@@ -898,9 +900,14 @@
          $exten = (empty($exten)?"s":$exten);
          $exten = $exten.(empty($cidnum)?"":"/".$cidnum); //if a CID num is defined, add it

+         if ($cidroute) {
+           $ext->add($context, $exten, '', new ext_setvar('__FROM_DID','${EXTEN}'));
+           $ext->add($context, $exten, '', new ext_goto('L'.$cidnum,'s'));
+           $exten = "s/$cidnum";
+         }
          $ext->add($context, $exten, '', new ext_setvar('__FROM_DID','${EXTEN}'));
          // always set callerID name
-         $ext->add($context, $exten, '', new ext_gotoif('$[ "${CALLERID(name)}" != "" ] ','cidok'));
+         $ext->add($context, $exten, 'L'.$cidnum, new ext_gotoif('$[ "${CALLERID(name)}" != "" ] ','cidok'));
          $ext->add($context, $exten, '', new ext_setvar('CALLERID(name)','${CALLERID(num)}'));
          $ext->add($context, $exten, 'cidok', new ext_noop('CallerID is ${CALLERID(all)}'));

10/29/08 10:58:59 changed by p_lindheimer

looks like this is not quite there. It works, but blacklist (and probably cidlookup) are not hooking in right, see:

http://freepbx.org/forum/freepbx/users/cid-based-inbound-routing-problem

will have to have a look at those.

10/29/08 12:35:23 changed by p_lindheimer

updating patches (attached) for a new change that will include patches for:

  • core/functions.inc.php
  • blacklist/functions.inc.php
  • cidlookup/functions.inc.php

Please have a look and see if these are ok.

10/29/08 12:35:47 changed by p_lindheimer

  • attachment extdid.patch added.

10/29/08 12:36:16 changed by p_lindheimer

  • attachment blacklist.patch added.

10/29/08 12:36:38 changed by p_lindheimer

  • attachment cidlookup.patch added.

10/29/08 20:31:27 changed by p_lindheimer

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

(In [7182]) fixes #3345 requires core, blacklist and cidlookup to all be updated