Solved

Fixed Caller ID when using CFwdALL feature with Asterisk

Posted on 2014-01-06
16
2,095 Views
Last Modified: 2014-01-27
I am running Trixbox 2.8.0.4 with a Cisco 7961 handset. Our upstream provider is about to restrict our outbound Caller ID to the incoming number ranges we have with them.

If I use the CFwdALL button on the 7961 handset to forward all calls to a mobile the Caller ID shown on the receiver's mobile is the originating caller's.

e.g.
1. All calls to 0299222222 (handsets external number) are forwarded to 0411111111
2. External caller, 0433333333 makes a call to 0299222222.
3. Call is forwarded to 0411111111 and shows caller ID of 0433333333.

Once our upstream provider starts restricting our outbound caller id this call will be rejected by them as we don't own the number 0433333333.

Is there a way to force the forwarded call to use the forwarded extension's external number (0299222222) instead of the calling party's (0433333333) for the outbound Caller ID?
0
Comment
Question by:thenos
  • 9
  • 7
16 Comments
 
LVL 76

Expert Comment

by:arnold
Comment Utility
Generally speaking, your configuration needs to change not to pass through the Received caller ID.
Have not dealt with your setup to point you to a specific remedy.

In your configuration you likely have settings to maintain caller id, sendrid=yes, or orig callerid which is fine internally! your outgoing translation has to be configured to strip that information and attach your designated caller id!
0
 

Author Comment

by:thenos
Comment Utility
Thanks for your input Arnold.

When you say outgoing translation is there a particular configuration file/context you can point me to in relation to Asterisk?
0
 
LVL 76

Expert Comment

by:arnold
Comment Utility
The suggestion made are generally applicable to any VOIP based system.

Not sure what management of your setup exists.

See if the link below helps.
http://www.digium.com/en/products/switchvox/support/handling-caller-id
http://forums.asterisk.org/viewtopic.php?t=71339

Deals with configuring outgoing call rules.

What caller ID Is reflected when you dial out from that location?
0
 

Author Comment

by:thenos
Comment Utility
Thanks for that Arnold.

After some test calls and investigation of our dial plan I worked out it was the macro-outbound-called that sets the outgoing Caller ID.

From analysing the logs I think I need to edit the logic on line 5 in the code snippet below.

Lines 6 and 7 are skipped when forwarding IS NOT set (CID = 0299222222) and line 7 is skipped when forwarding IS set (CID = 0422222222)

 [macro-outbound-callerid]
include => macro-outbound-callerid-custom
exten => s,1,ExecIf($["${CALLINGPRES_SV}" != ""]?Set(CALLERPRES()=${CALLINGPRES_SV}))
exten => s,n,ExecIf($["${REALCALLERIDNUM:1:2}" = ""]?Set(REALCALLERIDNUM=${CALLERID(number)}))
exten => s,n(start),GotoIf($[ $["${REALCALLERIDNUM}" = ""] | $["${KEEPCID}" != "TRUE"] | $["${OUTKEEPCID_${ARG1}}" = "on"] ]?normcid)
exten => s,n,Set(USEROUTCID=${REALCALLERIDNUM})
exten => s,n,GotoIf($["foo${DB(AMPUSER/${REALCALLERIDNUM}/device)}" = "foo"]?bypass)
exten => s,n(normcid),Set(USEROUTCID=${DB(AMPUSER/${AMPUSER}/outboundcid)})
exten => s,n(bypass),Set(EMERGENCYCID=${DB(DEVICE/${REALCALLERIDNUM}/emergency_cid)})
exten => s,n,Set(TRUNKOUTCID=${OUTCID_${ARG1}})
exten => s,n,GotoIf($[ $["${EMERGENCYROUTE:1:2}" = ""] | $["${EMERGENCYCID:1:2}" = ""] ]?trunkcid)
exten => s,n,Set(CALLERID(all)=${EMERGENCYCID})
exten => s,n(exit),MacroExit()
exten => s,n(trunkcid),ExecIf($["${TRUNKOUTCID:1:2}" != ""]?Set(CALLERID(all)=${TRUNKOUTCID}))
exten => s,n(usercid),ExecIf($["${USEROUTCID:1:2}" != ""]?Set(CALLERID(all)=${USEROUTCID}))
exten => s,n(hidecid),ExecIf($["${CALLERID(name)}"="hidden"]?Set(CALLERPRES()=prohib_passed_screen))

; end of [macro-outbound-callerid]

Open in new window

0
 
LVL 76

Expert Comment

by:arnold
Comment Utility
I do not believe you need to alter anything, you simply need to set

Your current setup includes the option to preserve incoming callerID on transfer between extensions

CALLINGPRES_SV

Lines 6-8 deal with extention specific CallerID settings.
i.e. user on extension 3245 may have a direct dial line, so you would configure the user DB with extension 3245 when dialing out to have the caller id as xxxxx3245 as an example



TRUNKOUTCID='yourdefault' within the configuration which will override prior line 14
Line 10 gets the TRUNKOUTCID from ${OUTCID_${ARG1}}


The rule deals with the variances. in the current setup if you do not have TRUNKOUTCID set on line 10, and this is an incoming call with a caller ID being forwarded out and thus being set with the outgoing caller ID. Any other call that does not have a user extension with a phone mapping, will mean that there will be no caller ID transmitted.

possibly unknown/anonymous/blocked not sure what variations you may have.
0
 

Author Comment

by:thenos
Comment Utility
I do not believe you need to alter anything, you simply need to set
What do I need to set?
0
 
LVL 76

Expert Comment

by:arnold
Comment Utility
Look at line 10 of what you posted.  It refers to a variable outsid_.

Look in your configuration files for OUTCID_(not sure what it might be as I do not have this setup.)

Check your default outgoing callerID settings.

What if any caller ID is displayed when you dial from that location out?
0
 

Author Comment

by:thenos
Comment Utility
The Caller ID when making a call from an extension to an external number is that extension's specific DID.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 76

Expert Comment

by:arnold
Comment Utility
Ok, that data is pulled from the user database in the macro, lines 6-9

Ref line 5 that deals with whether to keepCID.

You seem to be missing the default CID setting.  if you have an unassigned phone, create an extension that is not assigned a direct DID dial.  Then dial using that extension out and see what if any caller ID shows up.  My guess is that there will be no caller ID associated because the current configuration does not have a default caller-id set.


Double check your outgoing call rules to make sure you have a default outgoing CALLER ID set that applies to all non-DID extensions.

i.e. you have 10 numbers, you must have an extenssion that is not mapped to a specific DID.
0
 

Author Comment

by:thenos
Comment Utility
Ok so I just created an extension 1092 with no attached DID. I made an outgoing call to my mobile using that extension and the called ID showed as 01092 so I think you could be right.
0
 

Author Comment

by:thenos
Comment Utility
Just to be clear I was hoping to pass the Caller ID of the extension that is forwarding the call, not just a single DID for all extensions that forward calls.

I can get the Caller ID to pass the default outbound trunk Caller ID but not the extension's DID that the call is being forwarded from
0
 
LVL 76

Expert Comment

by:arnold
Comment Utility
One thing at a time.  Based on your own comment, you must have a default outgoing CallerID set and configured or once your provider starts enforcing the outgoing callerID restriction a call such as the one you made using the newly created extension will not be completed. The caller  will hear dead air.

I think the system treats forwarding by a user from an extension differently than an incoming call that is automatically forwarded through a configuration on the system.

Not sure whether your setup allows for preserving incoming CallerID while transfering among internal extension while at the same time when the call is destined to the outside not have the incoming callerID preserved.
0
 

Author Comment

by:thenos
Comment Utility
Yes I realised if I set the trunk outgoing caller id and tick the option "Never Override CallerID" I get a better result. The forwarded call gets through the provider and display's the Outbound Caller ID set on the trunk.

This was quite helpful http://issues.freepbx.org/browse/FREEPBX-2370

It's better but not the exact result I am looking for as it is still not showing the caller extension's DID who is forwarding the call as the Caller ID
0
 
LVL 76

Assisted Solution

by:arnold
arnold earned 200 total points
Comment Utility
Are you distinguishing whether the forward out is automated or whether the user forwards out the incoming call?

Lines 14,15,16 from your code suggest that if the usercallerID is set, it is the one that will be pushed set, but line 13 seems to terminate the macro processing.  

As I do not have this setup, it is not clear to me whether line 13 needs to be there or not.
Or whether it is a modified version of the original that had lines 14,15,16 above the current line 17.
0
 

Accepted Solution

by:
thenos earned 0 total points
Comment Utility
0
 

Author Closing Comment

by:thenos
Comment Utility
Arnold gave some helpful advise but didn't really give me an answer
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

The purpose of this article is to demonstrate how we can use conditional statements using Python.
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now