Modify Contact Header

Dear all,

I’m having difficulty modifying the contact user via the dialplan. I need to make this change dynamically, as the contact user cannot be hardcoded in the pjsip.conf under the endpoint section — that file does not support variable substitution.

I’ve tried several approaches in extensions.conf to manipulate the Contact header using PJSIP_HEADER function, but it does not return anything. When I attempt to remove it, I get an error saying it doesn’t exist. When I try to update it, I’m told it doesn’t exist either. And if I try to add it, it results in a duplicate header — which, according to the RFC, is not ideal.


Thank you in advance.

I very much doubt it is supported, because there is no valid reason to support it. The only thing that the other party should ever do with the contact user is to return it, as is, in a request URI. It should have no meaning to them. The user, for authentication purposes, should be that in the From header.

What is the broken system that you are calling?

Also, when posting configurations and logs, here, please do so as plain text.

You haven’t shown how call-handler is called. Whilst Contact isn’t a header that you can validly add, as a Contact header is always added by the system, where needed, any headers need to be added from code running on the called channel.