CallerID Presentation – Presentation Prohibited But Still Passing Number

Home » Asterisk Users » CallerID Presentation – Presentation Prohibited But Still Passing Number
Asterisk Users 5 Comments

Hi,

Using Asterisk 13.36.0

I have a bit of a technical issue with hidden caller IDs. My setup, at the moment, is composed of two Asterisk boxes. In some instance, calls arrive on Asterisk A, and are then sent to Asterisk B for further processing. The link between them is SIP (both on the same switch/LAN). Asterisk A has a Digium PRI card (recent one) and a PRI link.

When I receive a hidden number (i.e. “presentation prohibited”) call on Asterisk A through PRI, I get the following Caller ID information (using
444-555-6666 as example):

” <4445556666>”

And

CallerID presence is received as “prohibited_not_screened”.

Which is fine – I know the incoming number BUT I am told not to show it to the end user. All good.

The problem is when calls are not processed on Asterisk A, but sent to Asterisk B for further processing. The dial command I used on Asterisk A
to send calls to AsterisB is the following:

exten => s,n,Dial(SIP/AsteriskB/123,,f(“”
<4445556666>)u(prohib_not_screened))

Again, so far so good. But, on Asterisk B in the appropriate context, on extension 123, my first command is a Verbose to show Callerid(all) and the received called id is shown as “Anonymous ” with CALLERID
presence still “prohib_not_screened”. I would like Asterisk B to receive the actual callerid (” <4445556666>“) along with the appropriate CallerID
presence value (which is correct already).

Basically I want to “pass forward” both CALLERID and CALLERIDPRES exactly as received on AteriskA to AsteriskB so that AsteriskB gets the exact same info AsteriskA had in the first place.

How do I accomplish this?

Michael

5 thoughts on - CallerID Presentation – Presentation Prohibited But Still Passing Number

  • I’ve been able to pass presentation status between tandems without needing to do anything explicitly. This seems to be part of the Caller ID that is transmitted without explicit intervention. Have you tested without using the u option? I’ve never used the u option and not had issues with presentation transmitting as supposed to. This is with manual Set(CALLERID(pres)=something) and then seeing if it gets honored on the other end. The remote Asterisk gets the full number, of course, but the called telephone does not display it. Perhaps the u option is intended for lines, not trunks, and so the number never gets sent?

    The only time I’ve found I (may) need to explicitly account for presentation is if I am regenerating the call, and then this needs to be accounted for in the call file (ignore that if that makes no sense).

    The only inconsistency I’ve encountered has to do with presentation mismatches between the name and the number. If, for instance, I want the number to display but not the same, setting the presentations as the documentation would suggest does not work. The behavior is inconsistent between different SIP clients and it didn’t work for me in any logical way. I didn’t bother to a file a bug report about it, as I worked around this by simply doing Set(CALLERID(name)=) to empty the name and write the original name back into the variable after the call. Your mileage may vary.

    NA

  • Thank you for taking the time. I believe you misunderstood my question. Callerid presence is passed perfectly already, as shown through Verbose commands on both sides of the SIP call. The CALLERID name and numbers aren’t passed properly ONLY when presence is “hidden”.

    As if Asterisk decided that since this is a hidden number, to replace the number with “Anynomous ” as opposed to letting the receiving Asterisk process it as desired with whatever logic I choose.

    I just tested without any u() or f() or s() functions – same result. No improvement or degradation with my issue. (Not sure why I had these options)

    —–Original Message—–
    From: phreak@phreaknet.org Sent: March 11, 2021 15:33
    To: Mike ; asterisk-users@lists.digium.com Subject: Re: [asterisk-users] CallerID presentation – presentation prohibited but still passing number

    I’ve been able to pass presentation status between tandems without needing to do anything explicitly. This seems to be part of the Caller ID that is transmitted without explicit intervention. Have you tested without using the u option? I’ve never used the u option and not had issues with presentation transmitting as supposed to. This is with manual Set(CALLERID(pres)=something) and then seeing if it gets honored on the other end. The remote Asterisk gets the full number, of course, but the called telephone does not display it. Perhaps the u option is intended for lines, not trunks, and so the number never gets sent?

    The only time I’ve found I (may) need to explicitly account for presentation is if I am regenerating the call, and then this needs to be accounted for in the call file (ignore that if that makes no sense).

    The only inconsistency I’ve encountered has to do with presentation mismatches between the name and the number. If, for instance, I want the number to display but not the same, setting the presentations as the documentation would suggest does not work. The behavior is inconsistent between different SIP clients and it didn’t work for me in any logical way. I didn’t bother to a file a bug report about it, as I worked around this by simply doing Set(CALLERID(name)=) to empty the name and write the original name back into the variable after the call. Your mileage may vary.

    NA

    link.

  • I should have mentioned before that the scenario I mentioned was with IAX2 trunking. I don’t use SIP for inter-switch trunking but I do for terminating lines. Maybe IAX2 and SIP handle Caller ID differently. Sorry, by this you mean that Asterisk does not see the number or that the telephone set does see it? It sounded like the former. One thing to note is that prohib and unavailable function differently. I looked at my code, and if a subscriber does not subscriber to Caller ID, I do something like the following:
    same =>
    n,ExecIf($[“${GOSUB_RETVAL}”=”1″|”${GOSUB_RETVAL}”=”2”]?NoOp():Set(CALLERID(pres)=unavailable))

    unavailable and prohib options are interpreted differently by different SIP clients (e.g. ATAs or softphones). I did some testing and found that there was inconsistent behavior with one option vs. the other. It may not be Asterisk but the telephone itself. I tested with a soft phone and it shows Anonymous . However, an actual telephone set shows “PRIVATE”, regardless of which option I choose. But, this is just a hunch, and I’m not certain.

  • THANK YOU! Case closed, that was indeed the problem.

    Michael

    From: asterisk-users Thank you for taking the time. I believe you misunderstood my question. Callerid presence is passed perfectly already, as shown through Verbose commands on both sides of the SIP call. The CALLERID name and numbers aren’t passed properly ONLY when presence is “hidden”.

    As if Asterisk decided that since this is a hidden number, to replace the number with “Anynomous ” as opposed to letting the receiving Asterisk process it as desired with whatever logic I choose.

    I just tested without any u() or f() or s() functions – same result. No improvement or degradation with my issue. (Not sure why I had these options)

    You probably want to set the “trust_id_outbound” option[1] to “yes”.

    [1]
    https://github.com/asterisk/asterisk/blob/master/configs/samples/sip.conf.sample#L377