[asterisk-users] Questions about SIP From, P-Asserted-Id fields and Diversion headers ?

George Joseph gjoseph at digium.com
Wed Jun 6 11:37:53 CDT 2018


On Wed, Jun 6, 2018 at 1:51 AM Olivier <oza.4h07 at gmail.com> wrote:

>
>
> 2018-06-05 20:29 GMT+02:00 George Joseph <gjoseph at digium.com>:
>
>>
>>
>> On Tue, Jun 5, 2018 at 10:59 AM Olivier <oza.4h07 at gmail.com> wrote:
>>
>>>
>>>
>>> 2018-06-05 15:27 GMT+02:00 George Joseph <gjoseph at digium.com>:
>>> Thank  you very much, George for replying.
>>>
>>>>
>>>>
>>>> On Tue, Jun 5, 2018 at 3:35 AM Olivier <oza.4h07 at gmail.com> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> After a long discussion with a friend, I would like to ask here:
>>>>>
>>>>> 1.According SIP RFCs, is possible/recommended to have different values
>>>>> in From and P-Asserted-Id fields ?
>>>>> For instance, From field showing 123456789 and P-Asserted-Id showing
>>>>> 987654321 (beside privacy considerations) ?
>>>>>
>>>>
>>>> Possible? yes absolutely.
>>>>
>>>
>>> How would you then configure both headers, respectively ?
>>>
>>> From memory, in previous testings, whenever  CALLERID was set to
>>> WHATEVER, P-Asserted-Id was also set to WHATEVER and vice versa, so that I
>>> inferred from this that P-Asserted-Id was meant for Privacy
>>> considerations and nothing else (see [1])
>>>
>>
>> PAI should be used to indicate the calling party's identification
>> regardless of privacy concerns.  In the dialplan you can use the CALLERPRES
>> function to control privacy on a call by call basis.
>>
>>
>>
> I'm sorry but I still have a doubt ...
> Let me re-phrase my question:
>
> My setup is:
> Asterisk <--- PJSIP ---> Bob
>
> For a reason, I want Bob's phone to receive a call with the following
> headers:
>
> From: "Foo" <sip:999 at 1.2.3.4>;tag=as75ee8c7c
> P-Asserted-Id: "Foo" <sip:88888 at 1.2.3.4 <sip%3A999 at 1.2.3.4>>;whatever
>
> My dialplan is:
> same = n,Set(CALLERID(num)=999)
> XXX
> same = n,Dial(PJSIP/123456 at bob)
>

> What shall I replace XXX with to allow me to set 88888 in the user part of
> P-Asserted-Id URI (see example above) ?
>

You don't need anything for XXX.  Just the "Set(CALLERID(num)=999)" should
do it.


> CALLERPRES would change From or P-Asserted-Id but not having different
> user parts in URI, would it ?
>

CALLERPRES affects From and Contact but doesn't affect PAI at all.  It does
add a Privacy header though.
BTW, you should use CALLERID(pres) instead of CALLERPRES.


>
> To my knowledge, a possible way to implement what I'm after is to "turn
> off" P-Asserted-Id feature, add a custom P-Asserted-Id header with
> PJSIP_HEADER.
> Am I missing something ?
>

Either that or I am. :)   The example you have above should work.



>
>
>
>>
>>
>>>
>>>
>>> [1]
>>> https://www.voip-info.org/p-asserted-identity-and-remote-party-id-header/
>>>
>>>
>>>> Recommended? who knows?  Implementations are all over the place.  I've
>>>> always thought of the From header as identifying the user agent making the
>>>> request which kinda agrees with RFC3261.   The PAI header should contain
>>>> the identity of the original caller.
>>>>
>>>>
>>>>>
>>>>> 2. When Bob forwards to Cory a call coming from Alice, would expect
>>>>> Diversion/History-Info header to include Alice's number ?
>>>>>
>>>>
>>>> No.  The diversion header shows who the diverter is.
>>>> https://tools.ietf.org/html/rfc5806
>>>>
>>>
>
> Thank for  this reference: I think I confused diverter/caller/callee roles
> when I first read this document.
>
> So, if Bob forwards to Cory a call from Alice, in which headers would you
> expect Alice and Bob numbers to respectively appear ?
>
>
Well, if you just have 3 user agents without asterisk in the middle
Alice sends INVITE to Bob.
Bob returns a 302 to Alice with Cory as the Contact and Bob as the Diversion
Alice sends an ACK to Bob.
Alice sends a new INVITE to Cory.

If Asterisk is in the middle then...
Alice sends INVITE to Bob via Asterisk
Asterisk sends INVITE to Bob with Alice in From/PAI
Bob returns a 302 to Asterisk with Cory in Contact and Bob in Diversion
Asterisk returns a 181 "Call is being forwarded" to Alice.
Asterisk goes back to the dialplan to find Cory.
Asterisk sends an INVITE to Cory with Alice in From/PAI and Bob in
Diversion.
When Cory answers, Asterisk sends back a 200 OK to Alice with Cory in PAI
and Bob in Diversion


>
>
>
>>
>> Best regards
>> --
>> _____________________________________________________________________
>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>
>> Check out the new Asterisk community forum at:
>> https://community.asterisk.org/
>>
>> New to Asterisk? Start here:
>>       https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>>
>> asterisk-users mailing list
>> To UNSUBSCRIBE or update options visit:
>>    http://lists.digium.com/mailman/listinfo/asterisk-users
>
>
>>>>
>>>> --
>>>> George Joseph
>>>> Digium, Inc. | Software Developer
>>>> 445 Jan Davis Drive NW - Huntsville, AL 35806 - US
>>>> Check us out at: www.digium.com & www.asterisk.org
>>>>
>>>>
>>>> --
>>>> _____________________________________________________________________
>>>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>>>
>>>> Check out the new Asterisk community forum at:
>>>> https://community.asterisk.org/
>>>>
>>>> New to Asterisk? Start here:
>>>>       https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>>>>
>>>> asterisk-users mailing list
>>>> To UNSUBSCRIBE or update options visit:
>>>>    http://lists.digium.com/mailman/listinfo/asterisk-users
>>>>
>>>
>>> --
>>> _____________________________________________________________________
>>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>>
>>> Check out the new Asterisk community forum at:
>>> https://community.asterisk.org/
>>>
>>> New to Asterisk? Start here:
>>>       https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>>>
>>> asterisk-users mailing list
>>> To UNSUBSCRIBE or update options visit:
>>>    http://lists.digium.com/mailman/listinfo/asterisk-users
>>
>>
>>
>> --
>> George Joseph
>> Digium, Inc. | Software Developer
>> 445 Jan Davis Drive NW - Huntsville, AL 35806 - US
>> Check us out at: www.digium.com & www.asterisk.org
>>
>>
>> --
>> _____________________________________________________________________
>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>
>> Check out the new Asterisk community forum at:
>> https://community.asterisk.org/
>>
>> New to Asterisk? Start here:
>>       https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>>
>> asterisk-users mailing list
>> To UNSUBSCRIBE or update options visit:
>>    http://lists.digium.com/mailman/listinfo/asterisk-users
>>
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at:
> https://community.asterisk.org/
>
> New to Asterisk? Start here:
>       https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users



-- 
George Joseph
Digium, Inc. | Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - US
Check us out at: www.digium.com & www.asterisk.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20180606/c8ec7ba5/attachment.html>


More information about the asterisk-users mailing list