I'm trying to update the From header using dialplan , i'm setting it before dialing but its adding a new From header not updating the old one

I need to update the From and To uris before dialing the second leg , i’m using the pre-dial subroutines to update the headers before dialing , and when i use pjsip_header (add) its added successfully , but it leaves the original from in the sip header ,
when i use pjsip_header(update) it’s saying no header with that name to edit ,
so how can i fix the multiple To , From bug .

Thanks guys .

You can’t. There is no manipulation of the To or From headers, except as a result of things like changing callerid, from_user, and user in the dialed SIP URI.

2 Likes

thanks for your fast reply ,
callerid changing in dialplan updates the From header , is there any variable to use to update the from_domain also ?

also , is there any api i can use to update the header the way i need like ARI , AGI , AMI or any other api out there ?

There is no such functionality to update the From domain. There is no API access to update the headers beyond what is available like the callerid I mentioned.

1 Like

so it can only be updated using the fromdomain variable ( statically ) in pjsip.conf

Yes.

1 Like

I think it’s fair to say Asterisk tries to abstract away from low-level details of particular transports like SIP, analog lines, ISDN or whatever. If you want to do low-level SIP-specific stuff, then maybe look at alternative SIP-specific comms engines.

1 Like