Lines Matching refs:dialog

101 	_sip_dialog_t	*dialog;  member
109 sip_release_dialog_res(_sip_dialog_t *dialog) in sip_release_dialog_res() argument
115 if (dialog->sip_dlg_ref_cnt != 0) { in sip_release_dialog_res()
116 sip_write_to_log((void *)dialog, SIP_DIALOG_LOG | in sip_release_dialog_res()
119 assert(dialog->sip_dlg_ref_cnt == 0); in sip_release_dialog_res()
120 if (SIP_IS_TIMER_RUNNING(dialog->sip_dlg_timer)) in sip_release_dialog_res()
121 SIP_CANCEL_TIMER(dialog->sip_dlg_timer); in sip_release_dialog_res()
122 if (dialog->sip_dlg_call_id != NULL) in sip_release_dialog_res()
123 sip_free_header(dialog->sip_dlg_call_id); in sip_release_dialog_res()
124 if (dialog->sip_dlg_local_uri_tag != NULL) in sip_release_dialog_res()
125 sip_free_header(dialog->sip_dlg_local_uri_tag); in sip_release_dialog_res()
126 if (dialog->sip_dlg_remote_uri_tag != NULL) in sip_release_dialog_res()
127 sip_free_header(dialog->sip_dlg_remote_uri_tag); in sip_release_dialog_res()
128 if (dialog->sip_dlg_remote_target != NULL) in sip_release_dialog_res()
129 sip_free_header(dialog->sip_dlg_remote_target); in sip_release_dialog_res()
130 if (dialog->sip_dlg_local_contact != NULL) in sip_release_dialog_res()
131 sip_free_header(dialog->sip_dlg_local_contact); in sip_release_dialog_res()
132 if (dialog->sip_dlg_new_local_contact != NULL) in sip_release_dialog_res()
133 sip_free_header(dialog->sip_dlg_new_local_contact); in sip_release_dialog_res()
134 if (dialog->sip_dlg_route_set != NULL) in sip_release_dialog_res()
135 sip_free_header(dialog->sip_dlg_route_set); in sip_release_dialog_res()
136 if (dialog->sip_dlg_event != NULL) in sip_release_dialog_res()
137 sip_free_header(dialog->sip_dlg_event); in sip_release_dialog_res()
138 if (dialog->sip_dlg_req_uri.sip_str_ptr != NULL) { in sip_release_dialog_res()
139 free(dialog->sip_dlg_req_uri.sip_str_ptr); in sip_release_dialog_res()
140 dialog->sip_dlg_req_uri.sip_str_ptr = NULL; in sip_release_dialog_res()
141 dialog->sip_dlg_req_uri.sip_str_len = 0; in sip_release_dialog_res()
143 if (dialog->sip_dlg_rset.sip_str_ptr != NULL) { in sip_release_dialog_res()
144 free(dialog->sip_dlg_rset.sip_str_ptr); in sip_release_dialog_res()
145 dialog->sip_dlg_rset.sip_str_len = 0; in sip_release_dialog_res()
146 dialog->sip_dlg_rset.sip_str_ptr = NULL; in sip_release_dialog_res()
149 msg_chain = dialog->sip_dlg_log[count].sip_msgs; in sip_release_dialog_res()
158 (void) pthread_mutex_destroy(&dialog->sip_dlg_mutex); in sip_release_dialog_res()
159 free(dialog); in sip_release_dialog_res()
225 sip_dialog_req_uri(sip_dialog_t dialog) in sip_dialog_req_uri() argument
231 _dialog = (_sip_dialog_t *)dialog; in sip_dialog_req_uri()
274 sip_dlg_recompute_rset(_sip_dialog_t *dialog, _sip_msg_t *sip_msg, int what) in sip_dlg_recompute_rset() argument
278 if (dialog->sip_dlg_route_set != NULL) { in sip_dlg_recompute_rset()
279 sip_free_header(dialog->sip_dlg_route_set); in sip_dlg_recompute_rset()
280 dialog->sip_dlg_route_set = NULL; in sip_dlg_recompute_rset()
282 if (dialog->sip_dlg_req_uri.sip_str_ptr != NULL) { in sip_dlg_recompute_rset()
283 free(dialog->sip_dlg_req_uri.sip_str_ptr); in sip_dlg_recompute_rset()
284 dialog->sip_dlg_req_uri.sip_str_ptr = NULL; in sip_dlg_recompute_rset()
285 dialog->sip_dlg_req_uri.sip_str_len = 0; in sip_dlg_recompute_rset()
287 if (dialog->sip_dlg_rset.sip_str_ptr != NULL) { in sip_dlg_recompute_rset()
288 free(dialog->sip_dlg_rset.sip_str_ptr); in sip_dlg_recompute_rset()
289 dialog->sip_dlg_rset.sip_str_ptr = NULL; in sip_dlg_recompute_rset()
290 dialog->sip_dlg_rset.sip_str_len = 0; in sip_dlg_recompute_rset()
292 ret = sip_dialog_get_route_set(dialog, sip_msg, what); in sip_dlg_recompute_rset()
316 sip_dialog_set_route_hdr(_sip_dialog_t *dialog, sip_dlg_route_set_t *rset_head, in sip_dialog_set_route_hdr() argument
333 sip_write_to_log((void *)dialog, SIP_DIALOG_LOG | in sip_dialog_set_route_hdr()
338 dialog->sip_dlg_rset.sip_str_len = rlen + rcnt - 1; in sip_dialog_set_route_hdr()
339 dialog->sip_dlg_rset.sip_str_ptr = malloc(rlen + rcnt); in sip_dialog_set_route_hdr()
340 if (dialog->sip_dlg_rset.sip_str_ptr == NULL) in sip_dialog_set_route_hdr()
342 rsp = dialog->sip_dlg_rset.sip_str_ptr; in sip_dialog_set_route_hdr()
349 val = sip_get_header_value(dialog->sip_dlg_remote_target, NULL); in sip_dialog_set_route_hdr()
353 free(dialog->sip_dlg_rset.sip_str_ptr); in sip_dialog_set_route_hdr()
354 dialog->sip_dlg_rset.sip_str_len = 0; in sip_dialog_set_route_hdr()
355 dialog->sip_dlg_rset.sip_str_ptr = NULL; in sip_dialog_set_route_hdr()
364 dialog->sip_dlg_req_uri.sip_str_ptr = malloc( in sip_dialog_set_route_hdr()
366 if (dialog->sip_dlg_req_uri.sip_str_ptr == NULL) { in sip_dialog_set_route_hdr()
368 free(dialog->sip_dlg_rset.sip_str_ptr); in sip_dialog_set_route_hdr()
369 dialog->sip_dlg_rset.sip_str_len = 0; in sip_dialog_set_route_hdr()
370 dialog->sip_dlg_rset.sip_str_ptr = NULL; in sip_dialog_set_route_hdr()
373 (void) strncpy(dialog->sip_dlg_req_uri.sip_str_ptr, rsp + in sip_dialog_set_route_hdr()
376 dialog->sip_dlg_req_uri.sip_str_ptr[ in sip_dialog_set_route_hdr()
378 dialog->sip_dlg_req_uri.sip_str_len = in sip_dialog_set_route_hdr()
393 free(dialog->sip_dlg_rset.sip_str_ptr); in sip_dialog_set_route_hdr()
394 dialog->sip_dlg_rset.sip_str_len = 0; in sip_dialog_set_route_hdr()
395 dialog->sip_dlg_rset.sip_str_ptr = NULL; in sip_dialog_set_route_hdr()
401 free(dialog->sip_dlg_rset.sip_str_ptr); in sip_dialog_set_route_hdr()
402 dialog->sip_dlg_rset.sip_str_len = 0; in sip_dialog_set_route_hdr()
403 dialog->sip_dlg_rset.sip_str_ptr = NULL; in sip_dialog_set_route_hdr()
440 if (rsp > dialog->sip_dlg_rset.sip_str_ptr + in sip_dialog_set_route_hdr()
441 dialog->sip_dlg_rset.sip_str_len) { in sip_dialog_set_route_hdr()
442 sip_write_to_log((void *)dialog, SIP_DIALOG_LOG | in sip_dialog_set_route_hdr()
445 assert(rsp <= dialog->sip_dlg_rset.sip_str_ptr + in sip_dialog_set_route_hdr()
446 dialog->sip_dlg_rset.sip_str_len); in sip_dialog_set_route_hdr()
447 dialog->sip_dlg_rset.sip_str_ptr[dialog->sip_dlg_rset.sip_str_len] = in sip_dialog_set_route_hdr()
462 sip_write_to_log((void *)dialog, SIP_DIALOG_LOG | in sip_dialog_set_route_hdr()
469 dialog->sip_dlg_route_set = (sip_header_t)rhdr; in sip_dialog_set_route_hdr()
486 sip_dialog_get_route_set(_sip_dialog_t *dialog, _sip_msg_t *sip_msg, int what) in sip_dialog_get_route_set() argument
530 sip_write_to_log((void *)dialog, in sip_dialog_get_route_set()
543 sip_write_to_log((void *)dialog, in sip_dialog_get_route_set()
557 if (sip_dialog_set_route_hdr(dialog, rset_head, rset_cnt, in sip_dialog_get_route_set()
609 _sip_dialog_t *dialog; in sip_seed_dialog() local
680 dialog = calloc(1, sizeof (_sip_dialog_t)); in sip_seed_dialog()
681 if (dialog == NULL) { in sip_seed_dialog()
691 dialog->sip_dlg_remote_uri_tag = thdr; in sip_seed_dialog()
696 if ((dialog->sip_dlg_remote_target = sip_dup_header(chdr)) == in sip_seed_dialog()
701 if ((dialog->sip_dlg_local_uri_tag = sip_dup_header(fhdr)) == in sip_seed_dialog()
709 if ((dialog->sip_dlg_local_contact = sip_dup_header(chdr)) == in sip_seed_dialog()
713 dialog->sip_dlg_new_local_contact = NULL; in sip_seed_dialog()
716 if ((dialog->sip_dlg_call_id = sip_dup_header(cihdr)) == NULL) in sip_seed_dialog()
719 dialog->sip_dlg_event = sip_dup_header(evhdr); in sip_seed_dialog()
720 if (dialog->sip_dlg_event == NULL) { in sip_seed_dialog()
724 dialog->sip_dlg_rset.sip_str_ptr = NULL; in sip_seed_dialog()
725 dialog->sip_dlg_rset.sip_str_len = 0; in sip_seed_dialog()
726 dialog->sip_dlg_req_uri.sip_str_ptr = NULL; in sip_seed_dialog()
727 dialog->sip_dlg_req_uri.sip_str_len = 0; in sip_seed_dialog()
732 sip_dialog_get_route_set(dialog, sip_msg, dlg_type) != 0) { in sip_seed_dialog()
736 dialog->sip_dlg_local_cseq = cseq; in sip_seed_dialog()
738 dialog->sip_dlg_remote_cseq = cseq; in sip_seed_dialog()
739 dialog->sip_dlg_type = dlg_type; in sip_seed_dialog()
740 dialog->sip_dlg_on_fork = dlg_on_fork; in sip_seed_dialog()
741 dialog->sip_dlg_method = method; in sip_seed_dialog()
747 SIP_INIT_TIMER(dialog->sip_dlg_timer, 64 * timer1); in sip_seed_dialog()
748 tim_obj->dialog = dialog; in sip_seed_dialog()
755 SIP_SCHED_TIMER(dialog->sip_dlg_timer, (void *)tim_obj, in sip_seed_dialog()
757 if (!SIP_IS_TIMER_RUNNING(dialog->sip_dlg_timer)) in sip_seed_dialog()
759 (void) pthread_mutex_init(&dialog->sip_dlg_mutex, NULL); in sip_seed_dialog()
766 sip_write_to_log((void *)dialog, SIP_DIALOG_LOG | in sip_seed_dialog()
773 (uchar_t *)dialog->sip_dlg_id); in sip_seed_dialog()
779 if (sip_hash_add(sip_dialog_phash, (void *)dialog, in sip_seed_dialog()
780 SIP_DIGEST_TO_HASH(dialog->sip_dlg_id)) != 0) { in sip_seed_dialog()
785 dialog->sip_dlg_msgcnt = 1; in sip_seed_dialog()
786 sip_add_log(&dialog->sip_dlg_log[dialog->sip_dlg_state], in sip_seed_dialog()
787 (sip_msg_t)sip_msg, dialog->sip_dlg_msgcnt, SIP_DIALOG_LOG); in sip_seed_dialog()
789 SIP_DLG_REFCNT_INCR(dialog); in sip_seed_dialog()
790 return ((sip_dialog_t)dialog); in sip_seed_dialog()
792 sip_release_dialog_res(dialog); in sip_seed_dialog()
793 if (SIP_IS_TIMER_RUNNING(dialog->sip_dlg_timer)) in sip_seed_dialog()
794 SIP_CANCEL_TIMER(dialog->sip_dlg_timer); in sip_seed_dialog()
858 sip_complete_dialog(_sip_msg_t *sip_msg, _sip_dialog_t *dialog) in sip_complete_dialog() argument
878 if (error != 0 || dialog == NULL || in sip_complete_dialog()
880 (dialog->sip_dlg_method == INVITE || method != NOTIFY))) { in sip_complete_dialog()
883 if ((dialog->sip_dlg_type == SIP_UAC_DIALOG && method != NOTIFY && in sip_complete_dialog()
885 dialog->sip_dlg_local_cseq) || in sip_complete_dialog()
886 (dialog->sip_dlg_type == SIP_UAS_DIALOG && method != NOTIFY && in sip_complete_dialog()
888 dialog->sip_dlg_remote_cseq)) { in sip_complete_dialog()
938 if (dialog->sip_dlg_type == SIP_UAS_DIALOG) { in sip_complete_dialog()
945 if (dialog->sip_dlg_remote_target == NULL) { in sip_complete_dialog()
962 prev_state = dialog->sip_dlg_state; in sip_complete_dialog()
983 dialog->sip_dlg_event, &error); in sip_complete_dialog()
1011 if (dialog->sip_dlg_type == SIP_UAC_DIALOG) { in sip_complete_dialog()
1012 dialog->sip_dlg_remote_uri_tag = thdr; in sip_complete_dialog()
1013 if ((dialog->sip_dlg_remote_target = in sip_complete_dialog()
1019 dialog->sip_dlg_local_uri_tag = thdr; in sip_complete_dialog()
1021 dialog->sip_dlg_state = SIP_DLG_CONFIRMED; in sip_complete_dialog()
1024 (void) pthread_mutex_lock(&dialog->sip_dlg_mutex); in sip_complete_dialog()
1025 if (dialog->sip_dlg_state != SIP_DLG_NEW) { in sip_complete_dialog()
1026 sip_write_to_log((void *)dialog, SIP_DIALOG_LOG | in sip_complete_dialog()
1029 assert(dialog->sip_dlg_state == SIP_DLG_NEW); in sip_complete_dialog()
1030 if (dialog->sip_dlg_remote_target == NULL && chdr != NULL) { in sip_complete_dialog()
1031 if (dialog->sip_dlg_type != SIP_UAC_DIALOG) { in sip_complete_dialog()
1032 sip_write_to_log((void *)dialog, in sip_complete_dialog()
1036 assert(dialog->sip_dlg_type == SIP_UAC_DIALOG); in sip_complete_dialog()
1037 if ((dialog->sip_dlg_remote_target = in sip_complete_dialog()
1040 &dialog->sip_dlg_mutex); in sip_complete_dialog()
1045 if (sip_dialog_get_route_set(dialog, sip_msg, in sip_complete_dialog()
1046 dialog->sip_dlg_type) != 0) { in sip_complete_dialog()
1048 &dialog->sip_dlg_mutex); in sip_complete_dialog()
1055 dialog->sip_dlg_state = SIP_DLG_EARLY; in sip_complete_dialog()
1062 if (dialog->sip_dlg_remote_target == NULL) { in sip_complete_dialog()
1064 &dialog->sip_dlg_mutex); in sip_complete_dialog()
1066 sip_ulp_dlg_del_cb(dialog, in sip_complete_dialog()
1073 dialog->sip_dlg_state = SIP_DLG_CONFIRMED; in sip_complete_dialog()
1075 (void) pthread_mutex_unlock(&dialog->sip_dlg_mutex); in sip_complete_dialog()
1077 sip_ulp_dlg_del_cb(dialog, (sip_msg_t)sip_msg, in sip_complete_dialog()
1084 if (dialog->sip_dlg_type == SIP_UAS_DIALOG) { in sip_complete_dialog()
1085 dialog->sip_dlg_local_uri_tag = thdr; in sip_complete_dialog()
1087 if ((dialog->sip_dlg_remote_uri_tag = in sip_complete_dialog()
1090 &dialog->sip_dlg_mutex); in sip_complete_dialog()
1101 if ((dialog->sip_dlg_type == SIP_UAS_DIALOG) && (dialog->sip_dlg_state in sip_complete_dialog()
1109 if ((chdr == NULL) || ((dialog->sip_dlg_local_contact = in sip_complete_dialog()
1111 (void) pthread_mutex_unlock(&dialog->sip_dlg_mutex); in sip_complete_dialog()
1121 if (SIP_IS_TIMER_RUNNING(dialog->sip_dlg_timer)) in sip_complete_dialog()
1122 SIP_CANCEL_TIMER(dialog->sip_dlg_timer); in sip_complete_dialog()
1124 if (dialog->sip_dlg_type == SIP_UAC_DIALOG) { in sip_complete_dialog()
1125 val = sip_get_header_value(dialog->sip_dlg_local_uri_tag, in sip_complete_dialog()
1128 val = sip_get_header_value(dialog->sip_dlg_remote_uri_tag, in sip_complete_dialog()
1132 sip_write_to_log((void *)dialog, SIP_DIALOG_LOG | in sip_complete_dialog()
1138 val = sip_get_header_value(dialog->sip_dlg_call_id, &error); in sip_complete_dialog()
1144 if (dialog->sip_dlg_type == SIP_UAC_DIALOG) { in sip_complete_dialog()
1148 NULL, 0, NULL, 0, NULL, 0, (uchar_t *)dialog->sip_dlg_id); in sip_complete_dialog()
1153 NULL, 0, NULL, 0, NULL, 0, (uchar_t *)dialog->sip_dlg_id); in sip_complete_dialog()
1156 SIP_DLG_REFCNT_INCR(dialog); in sip_complete_dialog()
1157 (void) pthread_mutex_unlock(&dialog->sip_dlg_mutex); in sip_complete_dialog()
1162 if (sip_hash_add(sip_dialog_hash, (void *)dialog, in sip_complete_dialog()
1163 SIP_DIGEST_TO_HASH(dialog->sip_dlg_id)) != 0) { in sip_complete_dialog()
1169 (void) pthread_mutex_lock(&dialog->sip_dlg_mutex); in sip_complete_dialog()
1170 if (dialog->sip_dlg_type == SIP_UAS_DIALOG) { in sip_complete_dialog()
1171 if (dialog->sip_dlg_local_uri_tag != NULL) { in sip_complete_dialog()
1172 sip_free_header(dialog->sip_dlg_local_uri_tag); in sip_complete_dialog()
1173 dialog->sip_dlg_local_uri_tag = NULL; in sip_complete_dialog()
1176 if (dialog->sip_dlg_remote_uri_tag != NULL) { in sip_complete_dialog()
1177 sip_free_header(dialog->sip_dlg_remote_uri_tag); in sip_complete_dialog()
1178 dialog->sip_dlg_remote_uri_tag = NULL; in sip_complete_dialog()
1181 (void) pthread_mutex_unlock(&dialog->sip_dlg_mutex); in sip_complete_dialog()
1182 sip_dialog_terminate(dialog, (sip_msg_t)sip_msg); in sip_complete_dialog()
1186 sip_dlg_ulp_state_cb((sip_dialog_t)dialog, in sip_complete_dialog()
1187 (sip_msg_t)sip_msg, prev_state, dialog->sip_dlg_state); in sip_complete_dialog()
1189 return ((sip_dialog_t)dialog); in sip_complete_dialog()
1198 _sip_dialog_t *dialog = (_sip_dialog_t *)obj; in sip_dialog_match() local
1200 (void) pthread_mutex_lock(&dialog->sip_dlg_mutex); in sip_dialog_match()
1201 if (dialog->sip_dlg_state == SIP_DLG_DESTROYED) { in sip_dialog_match()
1202 (void) pthread_mutex_unlock(&dialog->sip_dlg_mutex); in sip_dialog_match()
1205 if (bcmp(dialog->sip_dlg_id, hindex, in sip_dialog_match()
1206 sizeof (dialog->sip_dlg_id)) == 0) { in sip_dialog_match()
1207 SIP_DLG_REFCNT_INCR(dialog); in sip_dialog_match()
1208 (void) pthread_mutex_unlock(&dialog->sip_dlg_mutex); in sip_dialog_match()
1211 (void) pthread_mutex_unlock(&dialog->sip_dlg_mutex); in sip_dialog_match()
1221 _sip_dialog_t *dialog = (_sip_dialog_t *)obj; in sip_dialog_dontfree() local
1224 (void) pthread_mutex_lock(&dialog->sip_dlg_mutex); in sip_dialog_dontfree()
1225 if (bcmp(dialog->sip_dlg_id, hindex, sizeof (dialog->sip_dlg_id)) in sip_dialog_dontfree()
1228 (void) pthread_mutex_unlock(&dialog->sip_dlg_mutex); in sip_dialog_dontfree()
1231 (void) pthread_mutex_unlock(&dialog->sip_dlg_mutex); in sip_dialog_dontfree()
1242 _sip_dialog_t *dialog = (_sip_dialog_t *)obj; in sip_dialog_free() local
1245 (void) pthread_mutex_lock(&dialog->sip_dlg_mutex); in sip_dialog_free()
1246 if (bcmp(dialog->sip_dlg_id, hindex, sizeof (dialog->sip_dlg_id)) in sip_dialog_free()
1249 if (dialog->sip_dlg_state != SIP_DLG_DESTROYED) { in sip_dialog_free()
1250 sip_write_to_log((void *)dialog, SIP_DIALOG_LOG | in sip_dialog_free()
1253 assert(dialog->sip_dlg_state == SIP_DLG_DESTROYED); in sip_dialog_free()
1254 if (dialog->sip_dlg_ref_cnt != 0) { in sip_dialog_free()
1255 (void) pthread_mutex_unlock(&dialog->sip_dlg_mutex); in sip_dialog_free()
1258 sip_write_to_log((void *)dialog, SIP_DIALOG_LOG, NULL, 0); in sip_dialog_free()
1259 sip_release_dialog_res(dialog); in sip_dialog_free()
1262 (void) pthread_mutex_unlock(&dialog->sip_dlg_mutex); in sip_dialog_free()
1279 _sip_dialog_t *dialog; in sip_dialog_find() local
1307 dialog = (_sip_dialog_t *)sip_hash_find(sip_dialog_hash, in sip_dialog_find()
1309 if (dialog == NULL) { in sip_dialog_find()
1313 dialog = (_sip_dialog_t *)sip_hash_find(sip_dialog_phash, in sip_dialog_find()
1317 return ((sip_dialog_t)dialog); in sip_dialog_find()
1328 _sip_dialog_t *dialog = (_sip_dialog_t *)tim_obj->dialog; in sip_dlg_self_destruct() local
1331 (void) pthread_mutex_lock(&dialog->sip_dlg_mutex); in sip_dlg_self_destruct()
1332 if (dialog->sip_dlg_state != SIP_DLG_NEW) { in sip_dlg_self_destruct()
1333 sip_write_to_log((void *)dialog, SIP_DIALOG_LOG | in sip_dlg_self_destruct()
1336 assert(dialog->sip_dlg_state == SIP_DLG_NEW); in sip_dlg_self_destruct()
1337 dialog->sip_dlg_state = SIP_DLG_DESTROYED; in sip_dlg_self_destruct()
1338 if (dialog->sip_dlg_type == SIP_UAC_DIALOG) { in sip_dlg_self_destruct()
1339 index = SIP_DIGEST_TO_HASH(dialog->sip_dlg_id); in sip_dlg_self_destruct()
1340 (void) pthread_mutex_unlock(&dialog->sip_dlg_mutex); in sip_dlg_self_destruct()
1341 sip_hash_delete(sip_dialog_phash, (void *)dialog->sip_dlg_id, in sip_dlg_self_destruct()
1344 (void) pthread_mutex_unlock(&dialog->sip_dlg_mutex); in sip_dlg_self_destruct()
1347 tim_obj->func(dialog, NULL, NULL); in sip_dlg_self_destruct()
1349 SIP_DLG_REFCNT_DECR(dialog); in sip_dlg_self_destruct()
1356 sip_dialog_terminate(_sip_dialog_t *dialog, sip_msg_t sip_msg) in sip_dialog_terminate() argument
1360 (void) pthread_mutex_lock(&dialog->sip_dlg_mutex); in sip_dialog_terminate()
1361 prev_state = dialog->sip_dlg_state; in sip_dialog_terminate()
1362 dialog->sip_dlg_state = SIP_DLG_DESTROYED; in sip_dialog_terminate()
1363 (void) pthread_mutex_unlock(&dialog->sip_dlg_mutex); in sip_dialog_terminate()
1365 sip_dlg_ulp_state_cb((sip_dialog_t)dialog, sip_msg, prev_state, in sip_dialog_terminate()
1366 dialog->sip_dlg_state); in sip_dialog_terminate()
1368 SIP_DLG_REFCNT_DECR(dialog); in sip_dialog_terminate()
1375 sip_dialog_delete(_sip_dialog_t *dialog) in sip_dialog_delete() argument
1382 if (dialog->sip_dlg_local_uri_tag == NULL || in sip_dialog_delete()
1383 dialog->sip_dlg_remote_uri_tag == NULL) { in sip_dialog_delete()
1387 if (SIP_IS_TIMER_RUNNING(dialog->sip_dlg_timer)) in sip_dialog_delete()
1388 SIP_CANCEL_TIMER(dialog->sip_dlg_timer); in sip_dialog_delete()
1389 sip_write_to_log((void *)dialog, SIP_DIALOG_LOG, NULL, 0); in sip_dialog_delete()
1390 sip_release_dialog_res(dialog); in sip_dialog_delete()
1393 index = SIP_DIGEST_TO_HASH(dialog->sip_dlg_id); in sip_dialog_delete()
1394 sip_hash_delete(sip_dialog_hash, (void *)dialog->sip_dlg_id, index, in sip_dialog_delete()
1402 sip_get_rtarg(_sip_dialog_t *dialog, _sip_msg_t *sip_msg) in sip_get_rtarg() argument
1406 if (dialog->sip_dlg_remote_target != NULL) in sip_get_rtarg()
1414 if ((dialog->sip_dlg_remote_target = sip_dup_header(chdr)) == NULL) in sip_get_rtarg()
1580 sip_copy_partial_dialog(_sip_dialog_t *dialog) in sip_copy_partial_dialog() argument
1587 if (dialog->sip_dlg_req_uri.sip_str_ptr != NULL) { in sip_copy_partial_dialog()
1589 malloc(dialog->sip_dlg_req_uri.sip_str_len + 1); in sip_copy_partial_dialog()
1595 dialog->sip_dlg_req_uri.sip_str_ptr, in sip_copy_partial_dialog()
1596 dialog->sip_dlg_req_uri.sip_str_len); in sip_copy_partial_dialog()
1598 dialog->sip_dlg_req_uri.sip_str_len] = '\0'; in sip_copy_partial_dialog()
1600 dialog->sip_dlg_req_uri.sip_str_len; in sip_copy_partial_dialog()
1602 if (dialog->sip_dlg_route_set != NULL) { in sip_copy_partial_dialog()
1603 if (dialog->sip_dlg_rset.sip_str_ptr == NULL) { in sip_copy_partial_dialog()
1604 sip_write_to_log((void *)dialog, SIP_DIALOG_LOG | in sip_copy_partial_dialog()
1607 assert(dialog->sip_dlg_rset.sip_str_ptr != NULL); in sip_copy_partial_dialog()
1609 malloc(dialog->sip_dlg_rset.sip_str_len + 1); in sip_copy_partial_dialog()
1617 dialog->sip_dlg_rset.sip_str_ptr, in sip_copy_partial_dialog()
1618 dialog->sip_dlg_rset.sip_str_len); in sip_copy_partial_dialog()
1620 dialog->sip_dlg_rset.sip_str_len] = '\0'; in sip_copy_partial_dialog()
1622 dialog->sip_dlg_rset.sip_str_len; in sip_copy_partial_dialog()
1625 sip_dup_header(dialog->sip_dlg_route_set); in sip_copy_partial_dialog()
1635 sip_dup_header(dialog->sip_dlg_local_uri_tag)) == NULL || in sip_copy_partial_dialog()
1637 sip_dup_header(dialog->sip_dlg_remote_target)) == NULL || in sip_copy_partial_dialog()
1639 sip_dup_header(dialog->sip_dlg_local_contact)) == NULL || in sip_copy_partial_dialog()
1641 sip_dup_header(dialog->sip_dlg_call_id)) == NULL) { in sip_copy_partial_dialog()
1645 if (dialog->sip_dlg_event != NULL) { in sip_copy_partial_dialog()
1646 new_dlg->sip_dlg_event = sip_dup_header(dialog->sip_dlg_event); in sip_copy_partial_dialog()
1652 new_dlg->sip_dlg_local_cseq = dialog->sip_dlg_local_cseq; in sip_copy_partial_dialog()
1653 new_dlg->sip_dlg_type = dialog->sip_dlg_type; in sip_copy_partial_dialog()
1664 sip_update_dialog(sip_dialog_t dialog, _sip_msg_t *sip_msg) in sip_update_dialog() argument
1674 _dialog = (_sip_dialog_t *)dialog; in sip_update_dialog()
1683 return (dialog); in sip_update_dialog()
1690 return (dialog); in sip_update_dialog()
1696 return (dialog); in sip_update_dialog()
1701 return (dialog); in sip_update_dialog()
1743 sip_dlg_ulp_state_cb(dialog, (sip_msg_t)sip_msg, in sip_update_dialog()
1744 prev_state, dialog->sip_dlg_state); in sip_update_dialog()
1753 return (dialog); in sip_update_dialog()
1763 return (dialog); in sip_update_dialog()
1800 index = SIP_DIGEST_TO_HASH(dialog->sip_dlg_id); in sip_update_dialog()
1814 if ((dialog = sip_complete_dialog(sip_msg, _dialog)) == in sip_update_dialog()
1825 return (dialog); in sip_update_dialog()
1860 sip_dialog_add_new_contact(sip_dialog_t dialog, _sip_msg_t *sip_msg) in sip_dialog_add_new_contact() argument
1872 (void) pthread_mutex_lock(&dialog->sip_dlg_mutex); in sip_dialog_add_new_contact()
1873 if (dialog->sip_dlg_method != INVITE || dialog->sip_dlg_state in sip_dialog_add_new_contact()
1875 (void) pthread_mutex_unlock(&dialog->sip_dlg_mutex); in sip_dialog_add_new_contact()
1880 if (dialog->sip_dlg_new_local_contact != NULL) in sip_dialog_add_new_contact()
1881 sip_free_header(dialog->sip_dlg_new_local_contact); in sip_dialog_add_new_contact()
1882 dialog->sip_dlg_new_local_contact = nhdr; in sip_dialog_add_new_contact()
1884 (void) pthread_mutex_unlock(&dialog->sip_dlg_mutex); in sip_dialog_add_new_contact()