Op 01-01-10 17:37, Alex Balashov schreef:
On 01/01/2010 11:32 AM, Antonio Goméz Soto wrote:
I am sorry, maybe I do not understand enough
about SIP and proxies.
Wouldn't it be possible to fake re-invites? Tell each phone that it
gets a reinvite coming from the other phone, and basically redirecting
the sound stream to an rtpproxy for example? or a codec translator?
I'd like to switch from g711 to g729 when the link gets overloaded
for example. Or record the phonecall.
I am trying to learn more about SIP. Aren't reinvites within
a dialog common?
Maybe I could make changes to openser to enable this?
Yes, reinvites are common, and you have correctly ascertained their
purpose.
What I think you are not understanding is that a reinvite, like any
other request, must be originated from an endpoint (a user agent). A
proxy is not a user agent; it cannot generate replies. The only thing
proxies do, as a matter of definition, is forward requests they receive,
and forward replies to them in the opposite direction (when applicable).
Again, I draw your attention to the HTTP server vs. Squid analogy we
made earlier. The question you are asking sounds equivalent to, "Can
Squid send a GET request?" The answer is no, Squid cannot send any
requests; it can only act on requests it receives and direct them
somewhere.
Right. I see now. It can only send out requests which it has received,
and not create new ones.
But on the other hand, kamailio *does* keep dialog state, so might it be
possible to create some add-on module, that injects fake messages into
the input stream? Using info that is in the dialog state?
Or.. come to think of it, would that mess up the dialog between the endpoint,
because it would increment counters that are maintained by the endpoint?
Antonio