I see -- I misunderstood your message previously. Comments inline.
-jiri
At 07:13 PM 2/25/2003, Stephan Reiff-Marganiec wrote:
Hi,
Context: I am currently writing a module that allows me to connect to a policy server -- not unlike CPL. It essentially routes the message out to the server and then receives a response. I get the message out ok, and will receive a complete sip message back. The module main function is called in the ser.cfg.
Here are my questions:
- how do I get a message that I have received -- say in char *msg_buf -- to
be the message that is used for further routing? The policy server might have changed any header fields or even created a (or several) completely new message(s).
If your server gave you a complete SIP message then you just need to send it out using a socket function.
- can the module send back intermediate messages, such as 1xx info, while
it is still continuing its work? This is to provide the user with feedback should things take while ...
It can -- you must go for stateful processing then. Which is in this case desirable since any TCP questions slow down and block and possible retransmissions would quickly block all your processes.
- I also want the module to react to SIP response messages (4xx and so). I
assumed providing a response_function would do this, but apparently not (I had a simple one which was just LOGging some text to the system log, but it never did create any entries). So how can I do this?
I don't know why your reply logging function did not work, but if you register a response_function, all processed replies will visit it (unless absorbed by stateful processing).
-Jiri