Hello,

I’ll be the first to admit I’m a complete novice to Kamailio, but I’m learning due to necessity. I’m working on setting up Kamailio as a sip proxy (SBC?). Any help would be massively appreciated.

The desired setup would be for Kamailio to as an external connection point to authenticate the connection and reverse proxy/NAT the rest of the traffic to the asterisk server, hiding internal topology as we go.

Right now I’m using dispatcher with NAT and ALIAS to push connections to proxy@{PROXY IP} to proxy@{ASTERISK EXTERNAL IP}.

I’m running into an issue where a “Message” is being sent, forwarded to the Asterisk server and responded to. Then Asterisk spawns a new call ID “To” the proxy rather than the original requestor which of course gets a 484 response. How can I somehow associate these two messages and complete the route?

 

MESSAGE sip:proxy@{ASTERISK EXTERNAL IP} SIP/2.0

Via: SIP/2.0/UDP {PROXY IP}:5060;branch=z9hG4bK0542.4d3d95c66b82f5825d9b90ba7ae88191.0

Via: SIP/2.0/UDP {CLIENT IP}:37916;received={CLIENT EXTERNAL IP};rport=37916;branch=z9hG4bKPj9b82293b-8ac4-4314-9cb8-d76716746e

Max-Forwards: 69

From: <sip:{CLIENT IP}>;tag=8aabdd54-6312-4ba4-bbe4-e713d2cf55a7

To: <sip:proxy@{PROXY IP}>

Call-ID: 9d7bc193-55d9-479b-8c34-3663c3a8bf3b

CSeq: 50215 MESSAGE

Accept: text/plain, application/im-iscomposing+xml

User-Agent: Digium Android Softphone 4.1.1 (2fccfc8f)

X-Digium-User-Agent: Digium Android Softphone 4.1.1 (2fccfc8f)

X-Digium-AppServer-RequestType: Preconfig

X-Digium-AppServer-Preconfig-Id: ca0175e891557c4e9d6f7314cdbf4044

X-Digium-Software-Version: 4.1.1 (2fccfc8f)

X-Digium-AppServer-ID: mobileui0000000004

Content-Type: text/plain

Content-Length:   182

P-hint: outbound

 

Message Contents

 

MESSAGE sip:{PROXY IP}:5060 SIP/2.0

Via: SIP/2.0/UDP {ASTERISK EXTERNAL IP}:5060;rport;branch=z9hG4bKPj6c1bdda3-2b78-4ae2-ac19-5ec2ca8b8928

From: <sip:proxy@{ASTERISK INTERNAL IP}>;tag=79cb0374-5b41-4550-9158-304a18bb1ee6

To: <sip:{PROXY IP}>

Contact: <sip:asterisk@{ASTERISK EXTERNAL IP}:5060>

Call-ID: 94c778a4-d3b3-42c1-ac26-25664d9d37bc

CSeq: 4076 MESSAGE

X-Digium-AppServer-ResponseType: PreconfigResponse

X-Digium-AppServer-Password: ofPnRi4Pt/tGqdSYNn97tiO8ju/maPvAsG7ZeESGyUUWUgvF0xlMuhAUDVzJE866dv0+QeOowFTawa6UQJKQsQ==

X-Digium-AppServer-Session: 471800327353850017

X-Digium-AppServer-Message-Salt: 85DA16A6C8F17E46

X-Digium-AppServer-Message-Sequence: 0

X-Digium-AppServer-ID: mobileui0000000004

Max-Forwards: 70

User-Agent: Asterisk PBX 13.1.0-6.7.rl.1516160751.a9f0643

Content-Type: text/plain

Content-Length:   600

 

MESSAGE CONTENT