Hello,
On 03.07.18 02:03, William Phillips wrote:
I have a need to encapsulate SIP traffic depending on
destination and obviously de-encapsulate traffic incoming from those destinations. The
approach to dealing with outbound SIP traffic seems pretty straight forward, I create an
appropriate routing block that determines if I need to encap the SIP message, if I do, I
forward it off to my module. The incoming traffic isn't particularly complicated,
I'm just not 100% sure on the way to give that de-encapsulated SIP message back to
kamailio to be processed.
It looks like I can achieve this using the TM module with the uac_req_t struct and
tm_bind.request but I really only see it used for SIP text messages in modules like XMPP
and SMS. Is this the appropriate approach to achieve what I need?
once you have the sip message, put it inside a buffer allocated with
pkg_malloc(BUF_SIZE+1), then you also need to set the details of source
address and local socket in a receive_info structure -- once having
these, you just execute receive_msg() -- look at udp_rcv_loop() inside
src/core/udp_server.c for more code.
Cheers,
Daniel
--
Daniel-Constantin Mierla --
www.asipto.com
www.twitter.com/miconda --
www.linkedin.com/in/miconda
Kamailio World Conference --
www.kamailioworld.com