Index: asterisk-1.4.x/pbx/pbx_dundi.c =================================================================== --- asterisk-1.4.x/pbx/pbx_dundi.c (revision 316037) +++ asterisk-1.4.x/pbx/pbx_dundi.c (working copy) @@ -4461,7 +4461,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) @@ -4628,7 +4628,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.4.x/channels/chan_sip.c =================================================================== --- asterisk-1.4.x/channels/chan_sip.c (revision 316037) +++ asterisk-1.4.x/channels/chan_sip.c (working copy) @@ -19481,7 +19481,7 @@ return 0; } if (!ntohs(bindaddr.sin_port)) - bindaddr.sin_port = ntohs(STANDARD_SIP_PORT); + bindaddr.sin_port = htons(STANDARD_SIP_PORT); bindaddr.sin_family = AF_INET; ast_mutex_lock(&netlock); if ((sipsock > -1) && (memcmp(&old_bindaddr, &bindaddr, sizeof(struct sockaddr_in)))) { Index: asterisk-1.4.x/channels/chan_skinny.c =================================================================== --- asterisk-1.4.x/channels/chan_skinny.c (revision 316037) +++ asterisk-1.4.x/channels/chan_skinny.c (working copy) @@ -4854,7 +4854,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.4.x/channels/chan_mgcp.c =================================================================== --- asterisk-1.4.x/channels/chan_mgcp.c (revision 316037) +++ asterisk-1.4.x/channels/chan_mgcp.c (working copy) @@ -4249,7 +4249,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) Index: asterisk-1.4.x/main/http.c =================================================================== --- asterisk-1.4.x/main/http.c (revision 316037) +++ asterisk-1.4.x/main/http.c (working copy) @@ -679,7 +679,7 @@ else if (!strcasecmp(v->name, "enablestatic")) newenablestatic = ast_true(v->value); else if (!strcasecmp(v->name, "bindport")) - sin.sin_port = ntohs(atoi(v->value)); + sin.sin_port = htons(atoi(v->value)); else if (!strcasecmp(v->name, "bindaddr")) { if ((hp = ast_gethostbyname(v->value, &ahp))) { memcpy(&sin.sin_addr, hp->h_addr, sizeof(sin.sin_addr));