Andre Kirchner
2006-Nov-15 14:15 UTC
[asterisk-users] Set port to which Asterisk should send its answer
Hi, I'm sending the following message from port X to port 5060 of another box running Asterisk, and it is answering back to port X from port 5060. Shouldn't Asterisk use the Via header to find out where to answer, and in this case send its answer to port 4000? OPTIONS sip:192.168.0.103 SIP/2.0\r\n Via: SIP/2.0/UDP 192.168.1.130:4000;branch=0.0\r\n CSeq: 4711 OPTIONS\r\n\r\n Thanks, Andre --------------------------------- Everyone is raving about the all-new Yahoo! Mail beta. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20061115/1ae7247f/attachment.htm
Eric "ManxPower" Wieling
2006-Nov-15 14:44 UTC
[asterisk-users] Set port to which Asterisk should send its answer
nat=yes might cause this, since with NAT we cannot trust the IP or the port that is in the data part of the packet. Andre Kirchner wrote:> I'm sending the following message from port X to port 5060 of another box running Asterisk, and it is answering back to port X from port 5060. Shouldn't Asterisk use the Via header to find out where to answer, and in this case send its answer to port 4000? > > OPTIONS sip:192.168.0.103 SIP/2.0\r\n > Via: SIP/2.0/UDP 192.168.1.130:4000;branch=0.0\r\n > CSeq: 4711 OPTIONS\r\n\r\n
Ron McLeod
2006-Nov-15 15:07 UTC
[asterisk-users] Set port to which Asterisk should send its answer
I am new to the Asterisk code, but it looks it the response to OPTIONS is
always sent to the IP address and UDP port that the request was received
from. Also, it looks like Asterisk doesn't deal well the VIA header anyway.
In chan_sip.c it looks like to gives-up if the VIA contains
"SIP/2.0/UDP":
if (strcasecmp(via, "SIP/2.0/UDP")) {
ast_log(LOG_WARNING, "Don't know how to respond
via
'%s'\n", via);
return -1;
}
Check you log and see if the warning message is there.
Ron
_____
From: asterisk-users-bounces@lists.digium.com
[mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Andre Kirchner
Sent: Wednesday, November 15, 2006 1:16 PM
To: asterisk-users@lists.digium.com
Subject: [asterisk-users] Set port to which Asterisk should send its answer
Hi,
I'm sending the following message from port X to port 5060 of another box
running Asterisk, and it is answering back to port X from port 5060.
Shouldn't Asterisk use the Via header to find out where to answer, and in
this case send its answer to port 4000?
OPTIONS sip:192.168.0.103 SIP/2.0\r\n
Via: SIP/2.0/UDP 192.168.1.130:4000;branch=0.0\r\n
CSeq: 4711 OPTIONS\r\n\r\n
Thanks,
Andre
_____
Everyone is raving about the
<http://us.rd.yahoo.com/evt=42297/*http:/advision.webevents.yahoo.com/mailbe
ta> all-new Yahoo! Mail beta.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.digium.com/pipermail/asterisk-users/attachments/20061115/5916a61c/attachment-0001.htm
Ron McLeod
2006-Nov-15 15:31 UTC
[asterisk-users] Set port to which Asterisk should send its answer
Whoops, sorry - it only handles "SIP/2.0/UDP"; which is what is expected, but it seems like it only checks for the VIA header for REGISTER, INVITE, CANCEL, BYE, and SUBSCRIBE requests. Ron _____ From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Andre Kirchner Sent: Wednesday, November 15, 2006 1:16 PM To: asterisk-users@lists.digium.com Subject: [asterisk-users] Set port to which Asterisk should send its answer Hi, I'm sending the following message from port X to port 5060 of another box running Asterisk, and it is answering back to port X from port 5060. Shouldn't Asterisk use the Via header to find out where to answer, and in this case send its answer to port 4000? OPTIONS sip:192.168.0.103 SIP/2.0\r\n Via: SIP/2.0/UDP 192.168.1.130:4000;branch=0.0\r\n CSeq: 4711 OPTIONS\r\n\r\n Thanks, Andre _____ Everyone is raving about the <http://us.rd.yahoo.com/evt=42297/*http:/advision.webevents.yahoo.com/mailbe ta> all-new Yahoo! Mail beta. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20061115/48ee6045/attachment.htm