Posted: Mon Apr 27, 2009 10:44 pm Post subject: [asterisk-dev] [Code Review] TCP, not finding peer.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.digium.com/r/236/
-----------------------------------------------------------
Review request for Asterisk Developers.
Summary
-------
With TCP, find_peer does not work when using p->recv. Because of the way TCP work's, the port number in p->recv is not what we're looking for at all. This results in all kinds of weirdness. I was originally queued into the problem when my calls would not complete because the extension wasn't found. Spent some time debugging and found that Asterisk wasn't even looking for the extension in the right context. Instead of using the context from the peer, it was using 'default' because the peer was never found, Hooray!
There is currently only one place that find_peer searches for a peer using sockaddr_in. If the peer is not found after using p->recv, a temp sockaddr_in struct is made using the Contact header in the sip_request. This has the correct port number in it.
This seems to work, but organizationally it may or may not be the best option. I debated on putting the Contact header parsing logic within find_peer, but leaving it outside find_peer seemed the least invasive. To me, find_peer is working correctly. The right sockaddr_in struct just needs to be past in. Thoughts?
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum