Beispiel #1
0
/**
 * Drop all dialogs belonging to one AOR.
 *  on deregistration for example.
 * @param aor - the public identity of the user
 * @returns the number of dialogs dropped 
 */
int S_drop_all_dialogs(str aor)
{
	s_dialog *d,*dn;
	int i,cnt=0;;
	
	LOG(L_DBG,"DBG:"M_NAME":S_drop_all_dialogs: Called for <%.*s>\n",aor.len,aor.s);

	for(i=0;i<s_dialogs_hash_size;i++){
		d_lock(i);
			d = s_dialogs[i].head;
			while(d){
				dn = d->next;
				if (d->direction == DLG_MOBILE_ORIGINATING &&
					d->aor.len == aor.len &&
					strncasecmp(d->aor.s,aor.s,aor.len)==0) {
					if (!terminate_s_dialog(d)) del_s_dialog(d);
					cnt++;
				}						
				d = dn;
			}
		d_unlock(i);
	}
	//print_s_dialogs(L_INFO);	
	return cnt;
}
Beispiel #2
0
/**
 * The dialog timer looks for expires dialogs and removes them
 * @param ticks - the current time
 * @param param - pointer to the dialogs list
 */
void dialog_timer(unsigned int ticks, void* param)
{
	s_dialog *d,*dn;
	int i;
	#ifdef WITH_IMS_PM
		int dialog_cnt[DLG_METHOD_MAX+1];
		for(i=0;i<=DLG_METHOD_MAX;i++)
			dialog_cnt[i]=0;
	#endif
		
	LOG(L_DBG,"DBG:"M_NAME":dialog_timer: Called at %d\n",ticks);
	if (!s_dialogs) s_dialogs = (s_dialog_hash_slot*)param;

	d_act_time();
	
	for(i=0;i<s_dialogs_hash_size;i++){
		d_lock(i);
			d = s_dialogs[i].head;
			while(d){
				dn = d->next;
				if (d->expires<=d_time_now) {
					if (!terminate_s_dialog(d)) del_s_dialog(d);
				}
				#ifdef WITH_IMS_PM
					else dialog_cnt[d->method]++;
				#endif						
				d = dn;
			}
		d_unlock(i);
	}
	print_s_dialogs(L_INFO);
	#ifdef WITH_IMS_PM
		for(i=0;i<=DLG_METHOD_MAX;i++)
			IMS_PM_LOG11(RD_NbrDialogs,get_dialog_method_str(i),dialog_cnt[i]);		
	#endif						
}
Beispiel #3
0
/**
 * The dialog timer looks for expires dialogs and removes them
 * @param ticks - the current time
 * @param param - pointer to the dialogs list
 */
void dialog_timer(unsigned int ticks, void* param)
{
	s_dialog *d,*dn;
	int i;
	
	LOG(L_DBG,"DBG:"M_NAME":dialog_timer: Called at %d\n",ticks);
	if (!s_dialogs) s_dialogs = (s_dialog_hash_slot*)param;

	d_act_time();
	
	for(i=0;i<s_dialogs_hash_size;i++){
		d_lock(i);
			d = s_dialogs[i].head;
			while(d){
				dn = d->next;
				if (d->expires<=d_time_now) {
					if (!terminate_s_dialog(d)) del_s_dialog(d);
				}						
				d = dn;
			}
		d_unlock(i);
	}
	print_s_dialogs(L_INFO);
}