Actually we have installed kamailio 5.4.2 and rtpengine like load balancer in a NAT environment. behind the nat we have 2 identical nodes using REFER for transfer  
call to another destiny. On the other NAt side we have our public carrier.
When some node sends to kamailio the REFER message and kamailio reroutes this message to the carrier. The call is rejected due company policies.

We want to know how we can convert or modify the REFER message into INVITE for finally transfer the call.


kamailio -v:
version: kamailio 5.4.2 (x86_64/linux) 4fdc21
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: 4fdc21
compiled on 20:43:45 Dec  1 2020 with unknown

Uname -a:
Linux proxy 4.15.0-124-generic #127-Ubuntu SMP Fri Nov 6 10:54:43 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux