Asterisk doesnt have a method to add extra headers/body on an outbound registration/trunk
I’m looking for someone who can help me with that
I know opensips can do it, i use these functions for it:
I’d have a look at Kamailio. With Asterisk you’d probably have to change and then maintain and maintain and maintain… the source code. Kamailio allows the direct manipulation of SIP headers. I would start with using Kamailio as a stateful proxy server that does not do anything with the media, just the signalling.
Yes, I always use opensips for that, it’s the same as kamailio… But it’s a bit overkill, just for that…
Don’t care about maintaining, I don’t think it’s so much of a code change anyway
Adding extra SIP headers is not the problem, but you are adding a payload where there is usually none. I don’t think that you can do that without touching the source code. If I had to do something like that, I’d first check whether the pjsip lib can do that at a higher level and then see what has to be added to Asterisk.
In the end there could be something like PJSIP_PAYLOAD() which would work similarly like PJSIP_HEADER(). I think this can be done, but the problem is that the dialplan does not interact with the registration process. I could be wrong, but something like a “registration hook” would be needed.
I don’t even care, it can be hardcoded, I had a look at the pjsip_outboudregistration.c file , but I could find anything there where I could hardcode it
I think Asterisk is conceptionally the wrong place to do that. A SIP proxy/SBC would be the better place. I have a couple of other scenarios where Asterisk is not flexible enough (like registering to multiple proxies of a provider at the same time (works actually with some…)). A SIP server deals with individual SIP messages and the way they are related, Asterisk operates basically at the higher phone call level. I think the SIP server would not be overkill, but the fact that one now has to understand the SIP protocol…