Topic: Trouble Sending P-Asserted-Identity Header with Voxbeam

Hello, Asterisk Community,

I am a total noob and I am experiencing an issue where Voxbeam informed me that they are not receiving the P-Asserted-Identity header in my SIP messages. Below are the configurations of my pjsip.conf and extensions.conf files:


pjsip.conf:


[global]

type=global

user_agent=Asterisk PBX 20.8.1

[transport-udp]

type=transport

protocol=udp

bind=0.0.0.0

[voxbeam_outbound]

type=endpoint

transport=transport-udp

context=voxbeam_outbound

disallow=all

allow=ulaw,alaw,gsm,g729

aors=voxbeam_outbound

outbound_auth=voxbeam_outbound

from_user=+49XXXXX

from_domain=XXX.XX.XXX.XXX

direct_media=no

trust_id_inbound=yes

send_pai=yes

trust_id_outbound=yes

rtp_symmetric=yes

rewrite_contact=yes

[voxbeam_outbound]

type=aor

contact=sip:sbc.voxbeam.com

[voxbeam_outbound]

type=auth

auth_type=userpass

username=XXX ; Replace with your Voxbeam username

secret=XXX ; Replace with your Voxbeam password

host=sbc.voxbeam.com

context=voxbeam_outbound

[voxbeam_inbound]

type=endpoint

transport=transport-udp

context=voxbeam_inbound

disallow=all

allow=ulaw,alaw,gsm,g729

aors=voxbeam_inbound

inbound_auth=voxbeam_inbound

direct_media=no

trust_id_inbound=yes

send_pai=yes

rtp_symmetric=yes

rewrite_contact=yes

[voxbeam_inbound]

type=aor

contact=sip:95.211.119.240

[voxbeam_inbound]

type=auth

auth_type=userpass

username=XXX ; Replace with your Voxbeam username

password=XXX ; Replace with your Voxbeam password


extensions.conf:


[voxbeam_outbound]

exten => _X.,1,Set(CALLERID(num)=+49XXXXX)

exten => _X.,n,Set(PJSIP_HEADER(add,P-Asserted-Identity)=<sip:+49XXXX@XXX.XX.XXX.XXX>)

exten => _X.,n,Dial(PJSIP/0011102${EXTEN}@voxbeam_outbound)

exten => _X.,n,Hangup()

[voxbeam_inbound]

exten => _X.,1,Answer()

exten => _X.,n,Playback(hello-world)

exten => _X.,n,Hangup()

[default]

; Dial plan to call through Platinum

exten => _NXXNXXXXXX,1,Dial(PJSIP/0011102${EXTEN}@voxbeam_outbound)


Despite setting the PJSIP_HEADER and enabling send_pai=yes, Voxbeam reported that they are still not receiving the P-Asserted-Identity header. Any suggestions on what might be wrong or any additional configurations I need to include to ensure the header is sent correctly?

Can anyone help out and lead me in the right direction please?

Best,
Volkan

You haven’t actually shown a packet capture using “pjsip set logger on” for what Asterisk is sending, or the console output. Taking what a provider says at face value as being the truth without confirming has been shown in the past to send people down a direction that was not correct.

And the use of PJSIP_HEADER is incorrect. There is a note on the documentation about it[1]. Specifically:

If you call PJSIP_HEADER in a normal dialplan context you’ll be operating on the caller’s (incoming) channel which may not be what you want. To operate on the callee’s (outgoing) channel call PJSIP_HEADER in a pre-dial handler.

[1] PJSIP_HEADER - Asterisk Documentation

1 Like

Thank you very much for your comment. I really appreciate the feedback. I will structure everything correctly and get back to you.

PJSIP_HEADER is an alternative to send_pai. Unless the provider uses PAI in a non-standard way, the latter is the only one that you should need.

@jcolp @david551

That is what they wrote me after i tried to make a test call via asterisk

Dear Customer,

We're still not seeing the P-Asserted-Identity: header

U 2024/07/01 19:36:10.712000 xxx.xx.xxx.xxx:xxxxx -> xxx.xx.x.xxx:xxxx
INVITE sip:001110249xxxxxx@sbc.voxbeam.com SIP/2.0.
Via: SIP/2.0/UDP 10.0.2.15:5060;rport;branch=z9hG4bKPj9bb6266a-fecf-450d-9c14-ac8dc35e5128.
From: "Anonymous" <sip:+49xxxxxx@xxx.xx.xxx.xxx>;tag=bebdee09-09df-4b4f-bbf6-e51d85eec20e.
To: <sip:001110249xxxxxx@sbc.voxbeam.com>.
Contact: <sip:+49xxxxx@10.0.2.15:5060>.
Call-ID: 13d69b94-cbbb-4bd9-9d0b-dddcc35502a1.
CSeq: 18140 INVITE.
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, INFO, MESSAGE, REFER.
Supported: 100rel, timer, replaces, norefersub, histinfo.
Session-Expires: 1800.
Min-SE: 90.
Max-Forwards: 70.
User-Agent: Asterisk PBX 20.8.1.
Content-Type: application/sdp.
Content-Length: 325.
.
v=0.
o=- 1003059537 1003059537 IN IP4 10.0.2.15.
s=Asterisk.
c=IN IP4 10.0.2.15.
t=0 0.
m=audio 15248 RTP/AVP 0 8 3 18 101.
a=rtpmap:0 PCMU/8000.
a=rtpmap:8 PCMA/8000.
a=rtpmap:3 GSM/8000.
a=rtpmap:18 G729/8000.
a=fmtp:18 annexb=no.
a=rtpmap:101 telephone-event/8000.
a=fmtp:101 0-16.
a=ptime:20.
a=maxptime:140.
a=sendrecv.

It's over 10 years since I did anything with Asterisk, there started to be so many different variants we stopped trying to support it, I've never done anything with PJSIP & TBH I don't even know what it is, but on the old system we use for testing the adding of the P-Asserted-Identity: header is in the Dial header,

exten => _89.,1,NoOp(Spoof CallerID for Voxbeam Testing)
same => n,Set(CALLERID(num)=+xxxxxxxxxxxx)
same => n,Set(CALLERID(name)=Customer_CLI_Test)
same => n,SipAddHeader(P-Asserted-Identity: <sip:+xxxxxxxxxxxx@xxx.xxx.xxx.xxx:5060>)
same => n,Dial(SIP/0011101${EXTEN:2}@us.voxbeam.com)

my extensions.conf:

[addheader]
exten => s,1,NoOp(Adding P-Asserted-Identity header)
exten => s,n,Set(PJSIP_HEADER(add,P-Asserted-Identity)=<sip:+49xxxxxx@xxx.xx.xxx.xxx>)
exten => s,n,Return()

[voxbeam_outbound]
exten => _X.,1,Set(CALLERID(num)=+49xxxxxxx)
exten => _X.,n,Dial(PJSIP/0011102${EXTEN}@voxbeam_outbound,,b(addheader^s^1))
exten => _X.,n,Hangup()

[voxbeam_inbound]
exten => _X.,1,Answer()
exten => _X.,n,Playback(hello-world)
exten => _X.,n,Hangup()

[default]
; Dial plan to call through Platinum
exten => _NXXNXXXXXX,1,Dial(PJSIP/0011102${EXTEN}@voxbeam_outbound,,b(addheader^s^1))

my pjsip.conf:

[global]
type=global
user_agent=Asterisk PBX 20.8.1

[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0

[voxbeam_outbound]
type=endpoint
transport=transport-udp
context=voxbeam_outbound
disallow=all
allow=ulaw,alaw,gsm,g729
aors=voxbeam_outbound
outbound_auth=voxbeam_outbound
from_user=+49xxxxxxx
from_domain=xxx.xx.xxx.xxx
direct_media=no
trust_id_inbound=no
send_pai=yes
trust_id_outbound=no
rtp_symmetric=yes
rewrite_contact=yes

[voxbeam_outbound]
type=aor
contact=sip:sbc.voxbeam.com

[voxbeam_outbound]
type=auth
auth_type=userpass
username=xxxxx ; Replace with your Voxbeam username
secret=xxxxx  ; Replace with your Voxbeam password
host=sbc.voxbeam.com
context=voxbeam_outbound

[voxbeam_inbound]
type=endpoint
transport=transport-udp
context=voxbeam_inbound
disallow=all
allow=ulaw,alaw,gsm,g729
aors=voxbeam_inbound
inbound_auth=voxbeam_inbound
direct_media=no
trust_id_inbound=no
send_pai=yes
rtp_symmetric=yes
rewrite_contact=yes

[voxbeam_inbound]
type=aor
contact=sip:95.211.119.240

[voxbeam_inbound]
type=auth
auth_type=userpass
username=xxxxx  ; Replace with your Voxbeam username
password=xxxxx ; Replace with your Voxbeam password

The code i run in the asterisk cli:
channel originate PJSIP/001110249xxxxxx@voxbeam_outbound application Playback(demo-congrats)

The output i get:

ubuntu-VirtualBox*CLI> channel originate PJSIP/00111024917684816733@voxbeam_outbound application Playback(demo-congrats)
    -- Called 00111024917684816733@voxbeam_outbound
<--- Transmitting SIP request (1047 bytes) to UDP:108.59.2.133:5060 --->
INVITE sip:00111024917684816733@sbc.voxbeam.com SIP/2.0
Via: SIP/2.0/UDP 10.0.2.15:5060;rport;branch=z9hG4bKPjdc0c19b3-4905-4940-b852-2e662c00efec
From: "Anonymous" <sip:+4917684816733@178.24.184.124>;tag=726a7ef9-bd44-4016-86b7-df1b7162c0a0
To: <sip:00111024917684816733@sbc.voxbeam.com>
Contact: <sip:+4917684816733@10.0.2.15:5060>
Call-ID: f98fae8d-6fe7-422c-8a10-ede361b8c186
CSeq: 7189 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, INFO, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub, histinfo
Session-Expires: 1800
Min-SE: 90
Max-Forwards: 70
User-Agent: Asterisk PBX 20.8.1
Content-Type: application/sdp
Content-Length:   325

v=0
o=- 1710447741 1710447741 IN IP4 10.0.2.15
s=Asterisk
c=IN IP4 10.0.2.15
t=0 0
m=audio 28014 RTP/AVP 0 8 3 18 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:140
a=sendrecv

<--- Received SIP response (426 bytes) from UDP:108.59.2.133:5060 --->
SIP/2.0 100 Giving a try
Via: SIP/2.0/UDP 10.0.2.15:5060;received=xxx.xx.xxx.xxx;rport=49718;branch=z9hG4bKPjdc0c19b3-4905-4940-b852-2e662c00efec
From: "Anonymous" <sip:+49xxxx@xxx.xx.xxx.xxx>;tag=726a7ef9-bd44-4016-86b7-df1b7162c0a0
To: <sip:001110249xxxxxxx@sbc.voxbeam.com>
Call-ID: f98fae8d-6fe7-422c-8a10-ede361b8c186
CSeq: 7189 INVITE
Server: OpenSIPS (1.8.8-notls (x86_64/linux))
Content-Length: 0


<--- Received SIP response (477 bytes) from UDP:108.59.2.133:5060 --->
SIP/2.0 403 Forbidden - no credit
Via: SIP/2.0/UDP 10.0.2.15:5060;received=xxx.xx.xxx.xxx;rport=49718;branch=z9hG4bKPjdc0c19b3-4905-4940-b852-2e662c00efec
From: "Anonymous" <sip:+49xxxxxxx@xxx.xx.xxx.xxx>;tag=726a7ef9-bd44-4016-86b7-df1b7162c0a0
To: <sip:001110249xxxxxx@sbc.voxbeam.com>;tag=3ba6c8d31cba77822f0d57754d89d194.e56f
Call-ID: f98fae8d-6fe7-422c-8a10-ede361b8c186
CSeq: 7189 INVITE
Server: OpenSIPS (1.8.1-notls (x86_64/linux))
Content-Length: 0


<--- Transmitting SIP request (468 bytes) to UDP:108.59.2.133:5060 --->
ACK sip:001110249xxxxx@sbc.voxbeam.com SIP/2.0
Via: SIP/2.0/UDP 10.0.2.15:5060;rport;branch=z9hG4bKPjdc0c19b3-4905-4940-b852-2e662c00efec
From: "Anonymous" <sip:+49xxxx@xxx.xx.xxx.xxx>;tag=726a7ef9-bd44-4016-86b7-df1b7162c0a0
To: <sip:001110249xxxx@sbc.voxbeam.com>;tag=3ba6c8d31cba77822f0d57754d89d194.e56f
Call-ID: f98fae8d-6fe7-422c-8a10-ede361b8c186
CSeq: 7189 ACK
Max-Forwards: 70
User-Agent: Asterisk PBX 20.8.1
Content-Length:  0

ubuntu-VirtualBox*CLI> 

Can somebody please help out? I already mentinoed to voxbeam, that in my case it points out to no credit, even i put credit on it etc. but the consitently mention the P-Asserted-Identity: header

Best,
Volkan

The issue is that you’re using the CLI channel originate command to make the call. That bypasses the dialplan and since there’s no callerid set, no PAI header is sent. The easiest way to test would be to simply use a phone to make a call into asterisk that would get sent to your voxbeam_outbound context. You could also use the Originate AMI command since you can specify a callerid with it.

You should also remove the call to PJSIP_HEADER otherwise you’ll get two PAI headers in the INVITE.

1 Like

@gjoseph

Thank you so much for your help! Following your advice to use a phone for testing and the Originate AMI command worked perfectly.

The P-Asserted-Identity header is now showing up correctly.

I really appreciate your hepl!

Best,
Volkan