Ticket #910 (closed Patches: fixed)

Opened 6 years ago

Last modified 10 months ago

passing incoming CID when forwarding a call

Reported by: guy Assigned to:
Priority: block Milestone:
Component: CallerID Lookup Version: 2.1
Keywords: cid Cc:
Confirmation: Unreviewed SVN Revision (if applicable):
Backend Engine: All Backend Engine Version:

Description

I have menchioned this on irc few months back but never got a chance to submit the actual code it is not full patch but the code should work, as i was using it before installing freePBX almost as i am senting it here


incoming context (FORWARD_EXTERNAL_CALLERID (check box) LINE_NAME and LINE_NUM should be added to Inbound Routes page, so if someone needs to know that this call was transfered by * and from which line

exten => 2125551212,1,GotoIf($[${ISNULL(${FORWARD_EXTERNAL_CALLERID})}]?5) # check to see if we want to forward the call with incoming CID or our line CID
exten => 2125551212,2,Set(EXTERNAL_CALLERIDNUM="${LINE_NUM}-${CALLERIDNUM}")  # set the var with LINE_NUM as prefix then incoming CID
exten => 2125551212,3,Set(EXTERNAL_CALLERIDNAME="${LINE_NAME} ${CALLERIDNAME}") # do the same for CID name
exten => 2125551212,4. Goto(7) # skip the rest 
exten => 2125551212,1,GotoIf($[${ISNULL(${LINE_NUM})}]?7) # if no LINE_NUM is set then there is no prefix so don't set EXTERNAL_CALLERID* (this is the current freePBX setup) so calles will use trunk CID info
exten => 2125551212,5,Set(EXTERNAL_CALLERIDNUM="${LINE_NUM}")  # set the var with LINE_NUM as full number
exten => 2125551212,6,Set(EXTERNAL_CALLERIDNAME="${LINE_NAME}") # do the same for CID name
exten => 2125551212,6,Answer() #or whatever the normaly freePBX does...

outgoing context (FORCE_CID (check box) should be added to trunk to specify if the CID can be changed or not

...
exten => s,10,GotoIf($[${ISNULL(${FORCE_CID})}]?12) # check if this trunk allows changing of CID or not
exten => s,10,GotoIf($[${ISNULL(${EXTERNAL_CALLERIDNUM})}]?12) # check if we have EXTERNAL_CALLERIDNUM set (it will never be set for all calls that are coming from local context) see above as to when it will/will not be set
exten => s,11,SetCallerID("${EXTERNAL_CALLERIDNAME}" <${EXTERNAL_CALLERIDNUM}>) # change CID
exten => s,12, Dial(...) #do the dial thing

Change History

08/29/06 13:03:02 changed by guy

Hello, will my patch ever see the light of the day?

09/16/06 03:34:43 changed by RobThomas

Sorry, was waiting for a patch - Will see if I can write one this weekend.

(follow-up: ↓ 4 ) 09/16/06 10:15:25 changed by p_lindheimer

Am I confused or is this still a problem? Freepbx does forward the incoming callerid now on forwarded calls I thought. (It does for me at least in the situations that I use it (usually follow-me).

(in reply to: ↑ 3 ) 09/16/06 23:16:06 changed by guy

Replying to p_lindheimer:

This is needed for the setup where many DID's are being forwarded to the same number (external number like cellphone where there is no CID name only CID number) so the CID number has to be used to pass the DID information to the callee (and still optionally append CID of the caller)

Here is an example: We have two DIDs 2125551212 for company A and 3475551212 for company B and both are forwarded to the same cellphone. so if someone calls from 7181234567 the cellphone will show 7181234567 as CID but the callee doesn't know if this call comes forwarded from company A or B or perhaps it is not even being forwarded at all but it is someone calling his cellphone number directly. With the current setup of freepbx there is no way to know that. So here comes this patch to rectify the situation. For our example we will set ${LINE_NUM} to 00 for company A and 01 for company B so this time when the cellphone rings the CID will show this 007181234567 so the callee will know right a way that this call is coming from company A DID.

Hope if all makes sense now and can be found useful to the general public.

(follow-up: ↓ 6 ) 09/26/06 06:25:36 changed by RobThomas

Should we possibly have a 'Mangle' destination? It could append, remove caller ids, or DID's, um, what else would we want to mangle. Account codes? That would do what you want - it would go inbound route -> mangle (prefix callerid) -> ring group

(I like this idea)

(in reply to: ↑ 5 ) 12/03/06 11:46:34 changed by guy

Don't look like it is in 2.2rc1. When do you think you can add it?

07/07/08 21:50:05 changed by WAudette

  • owner changed.
  • confirmation set to Unreviewed.
  • component changed from Applications Module to CallerID Lookup.
  • engine_version changed.
  • svn_rev changed.

Pinged Philippe on this for review and moving to the CID Module.

WAudette

04/06/11 16:07:26 changed by mickecarlsson

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

Some time ago we added CID name prefix: to inbound routes, this is just what this ticket is about. So, you can add whatever CID name prefix to each inbound route.

You also have CID Options: in trunk to enhance it even more.

So, closing as fixed.