- replaced msg->src_ip w/ msg->rcv.src_ip (to be in sync w/ core)$
authorAndrei Pelinescu-Onciul <andrei@iptel.org>
Thu, 12 Dec 2002 21:42:33 +0000 (21:42 +0000)
committerAndrei Pelinescu-Onciul <andrei@iptel.org>
Thu, 12 Dec 2002 21:42:33 +0000 (21:42 +0000)
- updated all get_send_sock , forward_request & via_builder calls to the new
format (proto included) [now it compiles and hopefully works on udp]

modules/tm/t_funcs.c
modules/tm/t_fwd.c
modules/tm/t_lookup.c
modules/tm/t_msgbuilder.c
modules/tm/uac.c

index c9eb569..edfb7a9 100644 (file)
@@ -221,7 +221,7 @@ int t_relay_to( struct sip_msg  *p_msg , struct proxy_l *proxy,
                                        ret=E_BAD_ADDRESS;
                                        goto done;
                        }
-                       ret=forward_request( p_msg , proxy ) ;
+                       ret=forward_request( p_msg , proxy, p_msg->rcv.proto) ;
                        free_proxy( proxy );    
                        free( proxy );
 #ifdef ACK_FORKING_HACK
@@ -238,7 +238,7 @@ int t_relay_to( struct sip_msg  *p_msg , struct proxy_l *proxy,
                        p_msg->new_uri=backup_uri;
 #endif
                } else {
-                       ret=forward_request( p_msg , proxy ) ;
+                       ret=forward_request( p_msg , proxy, p_msg->rcv.proto ) ;
 #ifdef ACK_FORKING_HACK
                        backup_uri=p_msg->new_uri;
                        init_branch_iterator();
index 3e660bf..081b81f 100644 (file)
@@ -79,7 +79,7 @@ char *print_uac_request( struct cell *t, struct sip_msg *i_req,
        callback_event( TMCB_REQUEST_OUT, t, i_req, -i_req->REQ_METHOD);
 
        /* ... and build it now */
-       buf=build_req_buf_from_sip_req( i_req, len, send_sock );
+       buf=build_req_buf_from_sip_req( i_req, len, send_sock, i_req->rcv.proto );
 #ifdef DBG_MSG_QA
        if (buf[*len-1]==0) {
                LOG(L_ERR, "ERROR: print_uac_request: sanity check failed\n");
@@ -173,7 +173,7 @@ int add_uac( struct cell *t, struct sip_msg *request, str *uri,
        hostent2su( &to, &proxy->host, proxy->addr_idx, 
                proxy->port ? htons(proxy->port):htons(SIP_PORT));
 
-       send_sock=get_send_socket( &to );
+       send_sock=get_send_socket( &to , request->rcv.proto);
        if (send_sock==0) {
                LOG(L_ERR, "ERROR: add_uac: can't fwd to af %d "
                        " (no corresponding listening socket)\n",
index 3bf7f0b..5a8ccf6 100644 (file)
@@ -724,7 +724,7 @@ int init_rb( struct retr_buf *rb, struct sip_msg *msg )
                        return 0;
                }
        }
-       send_sock=get_send_socket(&rb->to);
+       send_sock=get_send_socket(&rb->to, msg->rcv.proto);
        if (send_sock==0) {
                LOG(L_ERR, "ERROR: init_rb: cannot fwd to af %d "
                        "no socket\n", rb->to.s.sa_family);
index e50f643..98e9c8f 100644 (file)
@@ -81,7 +81,7 @@ char *build_local(struct cell *Trans,unsigned int branch,
                branch_buf, &branch_len ))
                goto error;
        via=via_builder(&via_len, Trans->uac[branch].request.send_sock,
-               branch_buf, branch_len );
+               branch_buf, branch_len, Trans->uac[branch].request.send_sock->proto );
        if (!via)
        {
                LOG(L_ERR, "ERROR: t_build_and_send_CANCEL: "
@@ -225,7 +225,7 @@ char *build_uac_request(  str msg_type, str dst, str from,
                goto error;
        }
        via=via_builder(&via_len, t->uac[branch].request.send_sock,
-               branch_buf, branch_len );
+               branch_buf, branch_len, t->uac[branch].request.send_sock->proto);
        
        if (!via) {
                LOG(L_ERR, "ERROR: build_uac_request: via building failed\n");
@@ -365,7 +365,8 @@ char *build_uac_request_dlg(str* msg,           /* Method */
                goto error;
        }
 
-       via = via_builder(&via_len, t->uac[branch].request.send_sock, branch_buf, branch_len);
+       via = via_builder(&via_len, t->uac[branch].request.send_sock, 
+                       branch_buf, branch_len, t->uac[branch].request.send_sock->proto);
        if (!via) {
                LOG(L_ERR, "ERROR: build_uac_request_dlg: via building failed\n");
                goto error;
index 5f6b49c..374da71 100644 (file)
@@ -202,7 +202,7 @@ int t_uac( str *msg_type, str *dst,
        /* T->uac[branch].request.to_len=sizeof(union sockaddr_union); */
        hostent2su(&to, &proxy->host, proxy->addr_idx, 
                (proxy->port)?htons(proxy->port):htons(SIP_PORT));
-       send_sock=get_send_socket( &to );
+       send_sock=get_send_socket( &to, PROTO_UDP );
        if (send_sock==0) {
                LOG(L_ERR, "ERROR: t_uac: no corresponding listening socket "
                        "for af %d\n", to.s.sa_family );
@@ -345,7 +345,7 @@ int t_uac_dlg(str* msg,                     /* Type of the message - MESSAGE, OP
 
        branch=0;
        hostent2su(&to_su, &proxy->host, proxy->addr_idx, (proxy->port) ? htons(proxy->port) : htons(SIP_PORT));
-       send_sock=get_send_socket(&to_su);
+       send_sock=get_send_socket(&to_su, PROTO_UDP);
        if (send_sock == 0) {
                LOG(L_ERR, "ERROR: t_uac_dlg: no corresponding listening socket for af %d\n", to_su.s.sa_family );
                ret = E_NO_SOCKET;