@@ -234,10 +234,14 @@ void nua_destroy(nua_t *nua)
234
234
#if HAVE_SMIME /* Start NRC Boston */
235
235
sm_destroy (nua -> sm );
236
236
#endif /* End NRC Boston */
237
- su_home_unref (nua -> nua_home );
237
+ nua_unref (nua );
238
238
}
239
239
}
240
240
241
+ void nua_unref (nua_t * nua ) {
242
+ if (nua ) su_home_unref (nua -> nua_home );
243
+ }
244
+
241
245
/** Fetch callback context from nua.
242
246
*
243
247
* @param nua Pointer to @nua stack object
@@ -1089,3 +1093,60 @@ nua_handle_t *nua_handle_by_call_id(nua_t *nua, const char *call_id)
1089
1093
}
1090
1094
return NULL ;
1091
1095
}
1096
+
1097
+ /** Get leg from dialog. */
1098
+ const nta_leg_t * nua_get_dialog_state_leg (nua_handle_t * nh )
1099
+ {
1100
+ if (nh && nh -> nh_ds )
1101
+ return nh -> nh_ds -> ds_leg ;
1102
+ else
1103
+ return NULL ;
1104
+ }
1105
+
1106
+ /** Get su_home_t from nua handle. */
1107
+ su_home_t * nua_handle_get_home (nua_handle_t * nh )
1108
+ {
1109
+ if (nh && nh -> nh_home )
1110
+ return nh -> nh_home ;
1111
+ else
1112
+ return NULL ;
1113
+ }
1114
+
1115
+ /** Get su_home_t from nua. */
1116
+ su_home_t * nua_get_home (nua_t * nua )
1117
+ {
1118
+ if (nua && nua -> nua_home )
1119
+ return nua -> nua_home ;
1120
+ else
1121
+ return NULL ;
1122
+ }
1123
+
1124
+ /** Get nta_agent_t from nua. */
1125
+ nta_agent_t * nua_get_agent (nua_t * nua )
1126
+ {
1127
+ if (nua && nua -> nua_nta )
1128
+ return nua -> nua_nta ;
1129
+ else
1130
+ return NULL ;
1131
+ }
1132
+
1133
+ /** Set has invite of a nua handle */
1134
+ void nua_handle_set_has_invite (nua_handle_t * nh , unsigned val )
1135
+ {
1136
+ if (nh )
1137
+ nh -> nh_has_invite = val ;
1138
+ }
1139
+
1140
+ /** Check if nua handle is destroyed */
1141
+ unsigned nua_handle_is_destroyed (nua_handle_t * nh )
1142
+ {
1143
+ assert (nh );
1144
+ return nh -> nh_destroyed ;
1145
+ }
1146
+
1147
+ void nua_handle_dialog_usage_set_refresh_range (nua_handle_t * nh ,
1148
+ unsigned min , unsigned max ) {
1149
+ if (nh && nh -> nh_ds && nh -> nh_ds -> ds_usage ) {
1150
+ nua_dialog_usage_set_refresh_range (nh -> nh_ds -> ds_usage , min , max );
1151
+ }
1152
+ }
0 commit comments