More debugging i see that module res_pjsip_endpoint_identifier_ip.so match only the first occurence without see the endpoint registration status ( i think if endpoint registration status is down go to second occurence ).
Module res_pjsip_endpoint_identifier_user.so it’s it’s inusable , take only the From header of invite.
In invite there is one another string on the fist line :
INVITE sip:isp_wan1@myip:5061 SIP/2.0
There is a solution to use INVITE sip uri header instead from sip uri header ?
The identify section matches on source IP address only without regard to anything else (including endpoint status as it shouldn’t matter). It’s not made to match like how you are needing, none of the endpoint identifiers currently are. You would need to continue to use the IP based matching and parse in the dialplan using PJSIP_HEADER or write your own endpoint identifier.
The call is entering on the endpoint that match identify and use the media_address of endpoint.
If the isp_wan1 on the endpoint is down and the call is entering from isp_wan2 (first match from pjsip match on the identify section isp_wan1 ) , it can’t inizialize the rtp flow between asterisk and the sip provider.
There is a function on dialplan to change the rtp media address?
ok if i wanna rewrite res_pjsip_endpoint_identifier_user.c for matching invite sip uri vs from sip uri is there some kind of guide for dev or is it too nasty thing ?
This endpoint identify “plugin” is good for internal user but for trunking is nosense.
There’s no guide or anything. You get a request and then it’s up to you to determine what endpoint it came from. As for trunking - I disagree, just because it’s not useful for exactly what you need doesn’t mean it’s nonsense. The IP based one is in use for ITSP matching for quite a few people. What’s different is that you are doing failover and need to determine not just who it is from - but where it came in on.
Ok thanks for explanation and suggestion.
There is a chance for a future endpoint identify module doing this?
I’m following asterisk from 1.2 release you are doing a great job!