sippy / b2bua

Sippy B2BUA is a RFC3261-compliant Session Initiation Protocol (SIP) stack and Back-to-back user agent (B2BUA) server software.
http://b2bua.org
BSD 2-Clause "Simplified" License
173 stars 72 forks source link

b2bua_simple not changing Call_Id #28

Open bertuola opened 6 years ago

bertuola commented 6 years ago

I did some tests with b2bua_simple (without rtp_proxy) and I noticed the Call_Id is the same between ingress and egress legs. In my understanding, a B2BUA should change it.

bambyster commented 6 years ago

The b2bua_simple does not change the Call-ID. The b2bua_radius however does and you can refer to it's code to see how to do it. The idea is to replace the CCEventTry before sending it out:

class CallController:
    def recvEvent(self, event, ua):
        if isinstance(event, CCEventTry):
            cId, cGUID, cli, cld, body, auth, caller_name = event.getData()
            new_call_id = SipCallId()
            event = CCEventTry((new_call_id, cGUID, cli, cld, body, auth, caller_name))
            ...