Ticket #2372 (closed Bugs: fixed)

Opened 6 years ago

Last modified 6 years ago

Call Forward and Caller-ID sending out foreign callerid when no trunk CID suppied and don't overide checked

Reported by: mickecarlsson Assigned to:
Priority: minor Milestone: 2.4
Component: Core - Trunks/Routing Version: 2.3.0
Keywords: Cc:
Confirmation: Need Feedback Distro:
Backend Engine: All Distro Ver:
Backend Ver: SVN Revision (if applicable):

Description

This is in Sweden, we are on pure SIP. Our provider require that we pass the A-number in the caller id. If we enable Call Forward on one of the extensions the forwarded call are rejected at our provider.

If I do a 'database show CF' I get the following: /CF/2475 : 040987654

Extension 2475 is set to forward to 040987654.

When I dial the inbound number for extension 2475 (from 040123456) I get this in the log (shortened for display and IP-addresses replaced with xxx):

dialparties.agi: Extension 2475 has call forward set to 040987654
  -- Executing Dial("SIP/xxx.xxx.xxx.xxx-08d5c0a8", "Local/040987654@from-internal/n|15|tr") in new stack

  -- Executing Macro("Local/040987654@from-internal-8ff2,2", "user-callerid|SKIPTTL") in new stack

  -- Executing NoOp("Local/040987654@from-internal-8ff2,2", "user-callerid: 040123456 040123456") in new stack
 
SIP/2.0 403 Call did not pass A-number check
Via: SIP/2.0/UDP 10.10.1.254:5060;branch=z9hG4bK70f1ad41;rport=5060
From: "040123456" <sip:040123456@xxx.xxx.xxx.xxx>;tag=as2afd9970
To: <sip:040987654@sip-xxxxxxxxxxx.xxxx.xx>;tag=b27e1a1d33761e85846fc98f5f3a7e58.dbb7

As you can see the caller (040123456) that calls the inbound number for extension 2475 gets his call routed to 040987654 but as FreePBX sets the callers caller id on the outgoing call the provider rejects it with:

SIP/2.0 403 Call did not pass A-number check

I don't know if it is allowed in the US to change caller id when making a call, but it is not allowed in Sweden.

Attachments

With-CF-NeverOverrideCID-set--no-Outbound-CID.txt (12.0 kB) - added by mickecarlsson on 09/11/07 02:16:28.
With CF, Never Override CID set, No Outbound CID set.
With-CF-NeverOverrideCID-set-with-OutboundCID.txt (12.3 kB) - added by mickecarlsson on 09/11/07 02:17:45.
With CF, Never Override CID set, With Outbound CID set

Change History

09/10/07 02:47:33 changed by p_lindheimer

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

Mike, go into your trunk screen and choose the the Never Override CallerID option for that trunk. This will keep foreign callerid from being passed on that trunk. (You will want to make sure to have a CallerID set for the trunk itself)

09/10/07 03:12:48 changed by mickecarlsson

Thank you for the quick answer. It works, sort of, the help text for the Never Override CallerID says this: Use this to never send a CallerID that you haven't explicity specified in this trunk or in the outbound callerid field of an extension /user.

If I check the Never Override CallerID it does not work even if I have a callerID set for the extension. I even tried the Emergency CID for the extension. Not until I tried to set a callerID on the trunk itself it worked.

Unfortunately that is not an option for us as our salespersons must have the CallerID for their extensions set.

09/10/07 10:55:21 changed by p_lindheimer

  • status changed from closed to reopened.
  • resolution deleted.
  • summary changed from Call Forward and Caller-ID not working with SIP if provider checks A-number to Call Forward and Caller-ID sending out foreign callerid when no trunk CID suppied and don't overide checked.

I'll re-open the ticket to review why it is sending out a callerid when the trunk CID is not set. We probably need to make it a requirement to set the trunk CID when using this override. However - you should be able to set the trunk CID and it should not override the extension's callerid.

Under normal calling conditions the behavior should be to use an extension's callerid if set, otherwise the trunk callerid. On a forwarded call the behavior should be to use the forwarded call's callerid if available and otherwise to use the trunk's callerid. And when checked, to use the trunk's callerid.

what it is NOT designed to do is to use the extension's callerid when checked. It is only designed to fall back to the trunk callerid. (which should be safe given what I described above).

09/10/07 11:24:47 changed by mickecarlsson

I have tested some more:

1. If there is an CF and Never Override CallerID is set and Outbound Caller ID is empty the following happens: The callers callerID is set and sent out on the trunk.

 -- Executing Set("Local/040987654@from-internal-b935,2", "TRUNKOUTCID=") in new stack
 -- Executing NoOp("Local/040987654@from-internal-b935,2", "CallerID set to "040123456" <040123456>") in new stack

2. If there is an CF and Never Override CallerID is set and Outbound Caller ID is set to a number (040223344) the following happens: The callers callerID is replaced with the Outbound Caller ID

-- Executing Set("Local/040987654@from-internal-7829,2", "TRUNKOUTCID=040223344") in new stack
-- Executing Set("Local/040987654@from-internal-7829,2", "CALLERID(all)=040223344") in new stack
-- Executing NoOp("Local/040987654@from-internal-7829,2", "CallerID set to "" <040223344>") in new stack

If I make a an outbound call the extensions callerID is set, not the trunk override so that is working as it should.

09/10/07 17:32:54 changed by p_lindheimer

  • confirmation changed from Unreviewed to Need Feedback.

the traces you are pasting are not adequate to assess what is going on in 1 and 2. You need to paste more of the trace. I need to see the whole flow that happens in macro-outbound-callerid to see it properly.

When you say If there is an CF and Never Override CallerID is set and Outbound Caller ID is set are you referring to Outbound CallerID for the extension or for the trunk. It should not be pulling the extension's outbound callerid in the CF case as far as I can recall but the fuller traces will be required to see where it is getting it.

09/11/07 02:16:28 changed by mickecarlsson

  • attachment With-CF-NeverOverrideCID-set--no-Outbound-CID.txt added.

With CF, Never Override CID set, No Outbound CID set.

09/11/07 02:17:45 changed by mickecarlsson

  • attachment With-CF-NeverOverrideCID-set-with-OutboundCID.txt added.

With CF, Never Override CID set, With Outbound CID set

09/11/07 02:21:13 changed by mickecarlsson

No need to say the a** word.

Console logfiles with Set Debug 5 and Set Verbose 5 uploaded. If you need more logs just say what you need and I will supply them to you. I have set up a lab pbx just to duplicate this and I can do whatever you need with this setup.

09/11/07 02:36:32 changed by mickecarlsson

I forgot to answer your last question.

In Trunk:

If the Never Override CallerID IS set and the Outbound CallerID is NOT set and there is a CF for an extension the caller ID of the caller to this extension is sent out as the A-number and that fails because it is not allowed.

If the Never Override CallerID IS set and the Outbound CallerID IS set and there is a CF for an extension the number set in Outbound CalledID in the trunk is sent out as the A-number and that works.

I thought it was like this:

1. If nothing is set, the callerID of the caller is sent out when a call is CF.

2. If in trunk, the Never Override CallerID is set, the callerID of the caller is replaced by what is is set in the AMPUSER/<ext with CF>/outboundcid and that is sent out as the A-number.

3. If in trunk, the Never Override CallerID is set and Outbound CallerID is set, the callerID is replaced with this and sent out as the A-number.

Or have I got this wrong?

09/11/07 13:19:24 changed by p_lindheimer

  • component changed from Feature Codes to Core - Trunks/Routing.

I'm getting confused (and have not yet looked at your traces). This is what should be the behavior wrt to CF, FollowMe, etc.

  • If Never Override CallerID in not checked, use the CID that came in with the call and if none, use the trunk CID
  • If Never Override CallerID is checked, then use the Trunk CID set on the trunk screen.

The outbound CID associated with an extension is only designed to be used when that extension makes a call. Not when a call for that extension gets forwarded.

The only bug that I am aware of from what you pointed out is that the CF CID is slipping out when no trunk CID is used.

I am confused in some of your comments above when you refer to Outbound CallerID, whether you are referring to the trunk CID or the outbound CID supplied for each extension. So one question (maybe this is answered in the traces which I can't review right now) - are you ever getting the extension's outbound CID sent in the CF scenario?

09/12/07 02:57:11 changed by mickecarlsson

I will try to describe the scenario (remember I am a Swede).

I have enabled CF on an extension, in this example, extension 1000 with an Inbound Route of 040112233. That extension have an entry in the database as "AMPUSER/1000/outboundcid 040112233" and there is also a "CFU/1000 040987654". I have NOT ticked the "Never Override CallerID" in Trunk setting.

If I receive a call to 040112233 from 040555666 its get routed to 040987654 due to the CF and the CallerID sent out is 040555666 and that fails because the CallerID is not in our A-number range.

Now I tick the "Never Override CallerID" in the Trunk setting, but I do NOT enter anything in the "Outbound Caller ID" (still in Trunk setting) as it is not mandatory.

If I now receive a call to 040112233 from 040555666 its get routed to 040987654 due to the CF and the CallerID sent out is 040555666 and that fails because the CallerID is not in our A-number range.

So ticking the "Never Override CallerID" in Trunk setting do nothing if you don't fill in a number in "Outbound Caller ID". But the help text for "Never Override Caller ID" says this:

"Use this to never send a CallerID that you haven't explicitly specified in this trunk or in the outbound callerid field of an extension/user"

This I interpret as if you tick the "Never Override CallerID" and not enter anything in the "Outbound Caller ID" (in Trunk) it will use the AMPUSER/1000/outboundcid (if supplied) in the Extensions module. And the help text in Extensions for field "Outbound CID" says:

"Overrides the caller id when dialing out a trunk. Any setting here will override the common outbound caller id set in the Trunk admin"

Now I tick the "Never Override CallerID" in the Trunk setting, but I enter 040112200 in the "Outbound Caller ID" (still in Trunk setting).

If I now receive a call to 040112233 from 040555666 its get routed to 040987654 due to the CF and the CallerID sent out is 040112200 and that works because the CallerID is in our A-number range.

I hope this will help you together with the log files. I will look at the code today to see what is happening, maybe I come up with something.

09/12/07 12:54:01 changed by p_lindheimer

  • priority changed from major to minor.

Mike,

you guys often have better English then plenty of native English speakers. I've spent plenty of time in Sweden so no excuses...

anyhow - you have confirmed what my understanding is and I agree there is a bug. To rehash it here is what should happen:

  • extension 1000 originates a call and has their outbound callerid set. That is what should be used on all trunks (except emergency routes)
  • extension 1000 has CF set and the given outbound trunk it will traverse does not have Never Override CallerID checked. The originating caller's CID should be used. If not present, the trunks optional outbound CID should be used. If that is not present, no CID should be sent.
  • extension 1000 has CF set and the given outbound trunk it will traverse has Never Override CallerID checked. In that case the CID should be set to the trunk's CID and in absence of that being set, should be set to nothing. OR we should require that a trunk CID is always set on all trunks since it is always the last choice anyhow.

I need to review with a couple of people how we best want to handle the bug, which in your case, it is allowing the originating caller's CID through.

As far as using the extension's outbound CID in a CF scenario. That is not supported. You can always make a feature request. I believe there may already be related feature requests in the system to do the same for Follow-Me.

If what I described is not what is happening and what I thought I understood you describing, let me know.

I'm also changing this to minor since there is a workaround (set the trunk's outbound cid) - although we will decide how to address it.

09/12/07 16:26:16 changed by mickecarlsson

Hi Philippe,

I think we have nailed it now, clear as crystal :-)

Take care,

Mikael

09/17/07 23:41:42 changed by p_lindheimer

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

r5044 - javascript to require trunks CID is set when using the feature since there needs to be a fallback, we don't want to set no CID.

09/21/07 03:28:37 changed by BennyR

Excuse if i state a comment to this already "fixed" bug. If i check the box "Never override CallerID" there should be first used the Extensions CID and if not given the CID specified for the trunk.

09/21/07 10:34:43 changed by p_lindheimer

Reread the ticket thread it should clarify how this works.