Index: asterisk-1.6.2.x/pbx/pbx_dundi.c =================================================================== --- asterisk-1.6.2.x/pbx/pbx_dundi.c (revision 316037) +++ asterisk-1.6.2.x/pbx/pbx_dundi.c (working copy) @@ -4679,7 +4679,7 @@ v = ast_variable_browse(cfg, "general"); while(v) { if (!strcasecmp(v->name, "port")){ - sin->sin_port = ntohs(atoi(v->value)); + sin->sin_port = htons(atoi(v->value)); if(last_port==0){ last_port=sin->sin_port; } else if(sin->sin_port != last_port) @@ -4832,7 +4832,7 @@ dundi_set_error(dundi_error_output); sin.sin_family = AF_INET; - sin.sin_port = ntohs(DUNDI_PORT); + sin.sin_port = htons(DUNDI_PORT); sin.sin_addr.s_addr = INADDR_ANY; /* Make a UDP socket */ Index: asterisk-1.6.2.x/channels/chan_sip.c =================================================================== --- asterisk-1.6.2.x/channels/chan_sip.c (revision 316037) +++ asterisk-1.6.2.x/channels/chan_sip.c (working copy) @@ -14340,7 +14340,7 @@ if (!strncmp(cur, "rport=", 6)) { int port = strtol(cur+6, NULL, 10); /* XXX add error checking */ - p->ourip.sin_port = ntohs(port); + p->ourip.sin_port = htons(port); } else if (!strncmp(cur, "received=", 9)) { if (ast_parse_arg(cur+9, PARSE_INADDR, &p->ourip)) ; /* XXX add error checking */ Index: asterisk-1.6.2.x/channels/chan_skinny.c =================================================================== --- asterisk-1.6.2.x/channels/chan_skinny.c (revision 316037) +++ asterisk-1.6.2.x/channels/chan_skinny.c (working copy) @@ -7176,7 +7176,7 @@ memcpy(&__ourip, hp->h_addr, sizeof(__ourip)); } if (!ntohs(bindaddr.sin_port)) { - bindaddr.sin_port = ntohs(DEFAULT_SKINNY_PORT); + bindaddr.sin_port = htons(DEFAULT_SKINNY_PORT); } bindaddr.sin_family = AF_INET; Index: asterisk-1.6.2.x/channels/chan_mgcp.c =================================================================== --- asterisk-1.6.2.x/channels/chan_mgcp.c (revision 316037) +++ asterisk-1.6.2.x/channels/chan_mgcp.c (working copy) @@ -4210,7 +4210,7 @@ memcpy(&__ourip, hp->h_addr, sizeof(__ourip)); } if (!ntohs(bindaddr.sin_port)) - bindaddr.sin_port = ntohs(DEFAULT_MGCP_CA_PORT); + bindaddr.sin_port = htons(DEFAULT_MGCP_CA_PORT); bindaddr.sin_family = AF_INET; ast_mutex_lock(&netlock); if (mgcpsock > -1)