Пример #1
0
/* void rls_notify_cb(struct cell* t, struct sip_msg* msg, int code, void *param) */
static void rls_notify_cb(struct cell* t, int type, struct tmcb_params* params)
{
	rls_notify_cb_param_t *cbd = NULL;

	if (!params) return;

	if (params->param) cbd = (rls_notify_cb_param_t *)*(params->param);
	if (!cbd) {
		ERR("BUG empty cbd parameter given to callback function\n");
		return;
	}

	if (params->code >= 300) { /* what else can we do with 3xx ? */
		int ignore = 0;
		
		switch (params->code) {
			case 408: 
				if (rls_ignore_408_on_notify) ignore = 1;
				/* due to eyeBeam's problems with processing more NOTIFY
				 * requests sent consequently without big delay */
				break;
		}
	
		if (!ignore) {
			WARN("destroying subscription from callback due to %d response on NOTIFY\n", params->code);
			destroy_subscription(cbd);
			TRACE("subscription destroyed!!!\n");
		}
	}

	mem_free(cbd);
}
Пример #2
0
static void pa_notify_cb(struct cell* t, int type, struct tmcb_params* params)
{
    pa_notify_cb_param_t *cbd = NULL;

    if (!params) return;

    /* Possible problems - see subscribe_cb in presence_b2b/euac_funcs.c */

    if (params->param) cbd = (pa_notify_cb_param_t *)*(params->param);
    if (!cbd) {
        ERR("BUG empty cbd parameter given to callback function\n");
        return;
    }

    if ((params->code >= 200) && (params->code < 300)) {
        if (params->rpl && (params->rpl != FAKED_REPLY))
            refresh_dialog(cbd, params->rpl);
    }
    if ((params->code >= 300)) {
        int ignore = 0;

        switch (params->code) {
        case 408:
            if (ignore_408_on_notify) ignore = 1;
            /* due to eyeBeam's problems with processing more NOTIFY
             * requests sent consequently without big delay */
            break;
        }

        if (!ignore) {
            WARN("destroying subscription from callback due to %d response on NOTIFY\n", params->code);
            destroy_subscription(cbd);
            TRACE("subscription destroyed!!!\n");
        }
    }

    shm_free(cbd);
}