Remove "Anonymous" text from From header - SIP invite

 I need to remove "Anonymous" text from below From header in INVITE request. Done following configuration but no luck.

Asterisk version 20.8.1

'SIP/2.0 100 Trying
  Via: SIP/2.0/UDP 
  localip:5060;
  received=localip;branch=z9hG4bK30fa5b7b;rport=5060

   From: "Anonymous" <sip:0117411111@sipserverip>;tag=as032a1a5d
  To: <sip:07611111111@sipserverip>
  Call-ID: 3e6730894cf25b8a05ce3e40289d05bd@localip:5060
  CSeq: 102 INVITE
  Content-Length: 0    

sip.conf

[mytrunk]
type=peer
host=myhostip
port=5060
context=mycontext
disallow=all
allow=ulaw,alaw
fromuser=0117411111
fromdomain=localip
defaultuser=0117411111  ; Sometimes needed to ensure the user is sent correctly
callerid="<0117411111>
qualify=yes

extentions.conf

[from-dialog]
exten => _X.,1,Set(CALLERID(name)=)  ; Clear any name set for caller ID
exten => _X.,n,Set(CALLERID(num)=0117411111)  ; Set only the caller ID number
exten => _X.,n,Dial(SIP/dialog_axa/${EXTEN})
exten => _X.,n,Hangup()

I’m implementing an asterisk to call a mobile number through a SIP trunk.
When I initiate a call, in the request log is this

CLI> originate SIP/dialog_axa/0763105409 application Playback hello-world
** == Using SIP RTP CoS mark 5
*
*CLI> Audio is at 12994
Adding codec ulaw to SDP
Adding codec alaw to SDP
Adding codec gsm to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (no NAT) to 123.xx.xx.xx:5060:
INVITE sip:0763105409@123.xx.xx.xx SIP/2.0
Via: SIP/2.0/UDP 10.xx.xx.xx:5060;branch=z9hG4bK721bfbe8
Max-Forwards: 70
From: “Anonymous” sip:asterisk@10.xx.xx.xx;tag=as4246bda8
To: sip:076xxxxxxx@123.xx.xx.xx
Contact: sip:asterisk@10.xx.xx.xx:5060
Call-ID: 2fb88cbe1f7822fb28ea7dee3aa30fb4@10.xx.xx.xx
CSeq: 102 INVITE
User-Agent: Asterisk PBX 20.8.1
Date: Mon, 10 Jun 2024 06:29:21 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 284

I want to remove “Anonymous” from the request header
I tried namouras ways but they didn’t work.
Bellow are my sip.conf and extentions.conf
Please help.

sip.conf

[general]
context=default
allowguest=no
allowoverlap=no
udpbindaddr=0.0.0.0
tcpenable=no
transport=udp
srvlookup=yes
fromuser=asterisk

[dialog_axa]
type=peer
host=123.xx.xx.xx
fromdomain=10.xx.xx.xx
context=from-dialog
dtmfmode=rfc2833
disallow=all
allow=ulaw
allow=alaw
allow=gsm
insecure=invite
qualify=yes
canreinvite=no
fromuser=asterisk
outboundproxy=123.xx.xx.xx
callerid=“DIALOG AXIATA PLC” <076140xxxx>
send_pai=yes
send_rpid=yes
trust_id_outbound=yes

extensions.conf

[from-dialog]
exten => s,1,Set(CALLERID(all)=“ADL” username@123.xx.xx.xx)
same => n,Set(SIP_HEADER(remove,From)=) ; Remove existing From header
same => n,SIPAddHeader(Remote-Party-ID:sip:${CALLERID(num)}@10.xx.xx.xx;privacy=full;screen=yes)
same => n,Dial(SIP/076140xxxx@dialog_axa)
same => n,Hangup() ; Hang up after call completes

We modified chain_sip.c and sip.h to achieve this

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.