Index: channels/chan_sip.c =================================================================== --- channels/chan_sip.c (revision 140292) +++ channels/chan_sip.c (working copy) @@ -2903,14 +2903,18 @@ dialog->sa.sin_family = AF_INET; dialog->timer_t1 = 500; /* Default SIP retransmission timer T1 (RFC 3261) */ p = find_peer(peer, NULL, 1, 0); + + portno = port ? atoi(port) : STANDARD_SIP_PORT; if (p) { int res = create_addr_from_peer(dialog, p); + if (portno) { + dialog->sa.sin_port = dialog->recv.sin_port = portno; + } ASTOBJ_UNREF(p, sip_destroy_peer); return res; } hostn = peer; - portno = port ? atoi(port) : STANDARD_SIP_PORT; if (srvlookup) { char service[MAXHOSTNAMELEN]; int tportno;