2009/5/28 Mahesh Paolini-Subramanya mahesh@aptela.com:
Well, the REGISTER Clue below seemed to work, the key is to do the force_rport() *before* t_newtran(). Which, now that I look at it, is exactly what Iñaki suggested. Thanx Iñaki! force_rport(); if (!t_newtran()) { sl_reply_error(); return(-1); }; if (is_method("SUBSCRIBE")) { handle_subscribe(); t_release(); };
oh yes, that makes sense :)
force_rport() adds the received port to the incoming top Via header. When the transaction is created (by doing "t_relay()", "t_newtran()"...) the Via content is inspected to know how to generate the responses. So yes, "rport" must be added before the transaction is created :) -