@@ -506,6 +506,7 @@ int process_bridge_200OK(struct sip_msg* msg, str* extra_headers,
506506 b2bl_entity_id_t * bentity0 , * bentity1 ;
507507 int entity_no ;
508508 b2b_req_data_t req_data ;
509+ str * ct_hdrs = NULL ;
509510
510511 bentity0 = tuple -> bridge_entities [0 ];
511512 bentity1 = tuple -> bridge_entities [1 ];
@@ -526,6 +527,9 @@ int process_bridge_200OK(struct sip_msg* msg, str* extra_headers,
526527 LM_DBG ("entity_no = %d, entity=%p, be[0]= %p\n" ,
527528 entity_no , entity , tuple -> bridge_entities [0 ]);
528529
530+ if ((ct_hdrs = b2b_extract_msg_contact_hdrs (msg )) != NULL )
531+ b2b_store_msg_contact_hdrs (tuple , & entity -> key , ct_hdrs );
532+
529533 switch (tuple -> state ) {
530534 case B2B_BRIDGING_HOLD_STATE :
531535 if (entity_no != 0 ) {
@@ -654,6 +658,7 @@ int process_bridge_200OK(struct sip_msg* msg, str* extra_headers,
654658 req_data .method = & method_ack ;
655659 req_data .extra_headers = extra_headers ;
656660 req_data .body = body ;
661+ req_data .contact_hdr_params = ct_hdrs ;
657662 req_data .dlginfo = bentity1 -> dlginfo ;
658663 if (b2b_api .send_request (& req_data ) < 0 )
659664 {
@@ -732,6 +737,7 @@ int process_bridge_200OK(struct sip_msg* msg, str* extra_headers,
732737 req_data .client_headers = & bentity1 -> hdrs ;;
733738 req_data .extra_headers = extra_headers ;
734739 req_data .body = body ;
740+ req_data .contact_hdr_params = ct_hdrs ;
735741 req_data .dlginfo = bentity1 -> dlginfo ;
736742 if (b2b_api .send_request (& req_data ) < 0 )
737743 {
@@ -753,6 +759,7 @@ int process_bridge_200OK(struct sip_msg* msg, str* extra_headers,
753759 req_data .client_headers = & bentity1 -> hdrs ;;
754760 req_data .extra_headers = extra_headers ;
755761 req_data .body = body ;
762+ req_data .contact_hdr_params = ct_hdrs ;
756763 req_data .dlginfo = bentity1 -> dlginfo ;
757764 if (b2b_api .send_request (& req_data ) < 0 )
758765 {
@@ -795,6 +802,7 @@ int process_bridge_200OK(struct sip_msg* msg, str* extra_headers,
795802 req_data .method = & method_invite ;
796803 req_data .extra_headers = NULL ;
797804 req_data .client_headers = & bentity0 -> hdrs ;
805+ req_data .contact_hdr_params = ct_hdrs ;
798806 req_data .body = body ;
799807 b2b_api .send_request (& req_data );
800808 bentity0 -> state = B2BL_ENT_NEW ;
@@ -905,6 +913,7 @@ int process_bridge_200OK(struct sip_msg* msg, str* extra_headers,
905913 req_data .client_headers = & bentity0 -> hdrs ;
906914 req_data .extra_headers = extra_headers ;
907915 req_data .body = body ;
916+ req_data .contact_hdr_params = ct_hdrs ;
908917 req_data .dlginfo = bentity0 -> dlginfo ;
909918 if (b2b_api .send_request (& req_data ) < 0 )
910919 {
@@ -1382,6 +1391,7 @@ static int bridging_start_old_ent(b2bl_tuple_t* tuple, b2bl_entity_id_t *old_ent
13821391 req_data .extra_headers = NULL ;
13831392 req_data .client_headers = & old_entity -> hdrs ;
13841393 req_data .body = body ;
1394+ req_data .contact_hdr_params = b2b_get_msg_contact_hdrs (tuple , & old_entity -> key );
13851395 b2b_api .send_request (& req_data );
13861396 old_entity -> state = B2BL_ENT_NEW ;
13871397 if (body ) {
@@ -2163,7 +2173,7 @@ int b2bl_bridge_msg(struct sip_msg* msg, str* key, int entity_no,
21632173 str to_uri = {NULL ,0 }, from_uri , from_dname ;
21642174 b2b_req_data_t req_data ;
21652175 int ret ;
2166- str local_contact ;
2176+ str local_contact , * ct_hdrs ;
21672177 int maxfwd ;
21682178
21692179 if (!msg || !key )
@@ -2242,6 +2252,7 @@ int b2bl_bridge_msg(struct sip_msg* msg, str* key, int entity_no,
22422252 }
22432253 bridging_entity = tuple -> bridge_entities [entity_no ];
22442254 old_entity = tuple -> bridge_entities [(entity_no ?0 :1 )];
2255+ ct_hdrs = b2b_get_msg_contact_hdrs (tuple , & old_entity -> key );
22452256
22462257 if (!old_entity || old_entity -> next || old_entity -> prev )
22472258 {
0 commit comments