[asterisk-dev] Peer callingpres - not used when we make SIP Outdial
Mark Michelson
mmichelson at digium.com
Wed Jul 9 17:40:50 CDT 2014
On 07/09/2014 05:30 PM, Matthew Jordan wrote:
> On Wed, Jul 9, 2014 at 4:34 PM, bala murugan <fightwithme at gmail.com> wrote:
>> Hi ,
>>
>> I tried to set the parameter value callingpres and tried making outdial
>> to the same peer , but the value we set to this parameter is never getting
>> used when make an outdial and looked at the code and it is never getting
>> used in the outdial portion , not sure if this is a BUG . I tried this on
>> asterisk 11.3.0 .
>>
>> Kindly advise if this is a known bug
>>
> The 'callingpres' value is not terribly well defined, other than the following:
>
> {quote}
> ;callingpres=allowed_passed_screen ; Set caller ID presentation
> ; See function CALLERPRES
> documentation for possible
> ; values.
> {quote}
>
> The current behaviour is to not use the callingpres value configured
> on a peer for outbound calls. Instead, the presentation used for the
> outbound call is derived from the presentation settings set up on the
> calling party:
>
> static int sip_call(struct ast_channel *ast, const char *dest, int timeout)
> ...
>
> p->callingpres = ast_party_id_presentation(&ast_channel_caller(ast)->id);
> ...
> /* Supply initial connected line information if available. */
> memset(&update_connected, 0, sizeof(update_connected));
> ast_party_connected_line_init(&connected);
> if (!ast_strlen_zero(p->cid_num)
> || (p->callingpres & AST_PRES_RESTRICTION) != AST_PRES_ALLOWED) {
> update_connected.id.number = 1;
> connected.id.number.valid = 1;
> connected.id.number.str = (char *) p->cid_num;
> connected.id.number.presentation = p->callingpres;
> }
> if (!ast_strlen_zero(p->cid_name)
> || (p->callingpres & AST_PRES_RESTRICTION) != AST_PRES_ALLOWED) {
> update_connected.id.name = 1;
> connected.id.name.valid = 1;
> connected.id.name.str = (char *) p->cid_name;
> connected.id.name.presentation = p->callingpres;
> }
>
> This makes some sense when you consider connected line: what we show
> the connected party would be determined to some extent on what the
> calling party wanted to show parties they connected to.
>
> So is this a bug? Probably depends on your interpretation on what
> should be given preference: the calling party's preferences, or what
> you have configured on the peer of the party being called. Asterisk's
> preference today is to use the calling party's preferences in such a
> scenario.
>
> I wouldn't classify it as a bug; probably just not the behaviour you wanted.
>
> OTOH, I'm willing for someone more knowledgeable about party
> identification and privacy settings to throw out a counter argument
> here...
>
The "callerid" and "callingpres" settings are intended to be used for
calls made *by* the peer, not *to* the peer.
If the outbound party does not provide any identifying information in
his responses (e.g. a P-Asserted-Identity), then Asterisk's connected
line code will use the "callerid" and "callingpres" values of the
outbound peer in order to try to tell the calling party who he is
connected to. However, with regards to information presented to the
outbound peer, the calling party's "callerid" and "callingpres" settings
are still applied.
If you are interested in setting the callingpres to a specific setting
when calling a peer, I suggest using the dialplan function CALLERID to
do so:
exten => foo,n,Set(CALLERID(num-pres)=prohib)
exten => foo,n,Set(CALLERID(name-pres)=prohib)
More information about the asterisk-dev
mailing list