示例#1
0
int ki_rls_handle_subscribe_uri(sip_msg_t* msg, str *wuri)
{
	struct sip_uri parsed_wuri;

	if (parse_uri(wuri->s, wuri->len, &parsed_wuri) < 0)
	{
		LM_ERR("failed to parse watcher URI\n");
		return -1;
	}

	return rls_handle_subscribe(msg, parsed_wuri.user, parsed_wuri.host);
}
示例#2
0
int w_rls_handle_subscribe(struct sip_msg* msg, char* watcher_uri)
{
	str wuri;
	struct sip_uri parsed_wuri;
	
	if (fixup_get_svalue(msg, (gparam_p)watcher_uri, &wuri) != 0)
	{
		LM_ERR("invalid uri parameter\n");
		return -1;
	}

	if (parse_uri(wuri.s, wuri.len, &parsed_wuri) < 0)
	{
		LM_ERR("failed to parse watcher URI\n");
		return -1;
	}

	return rls_handle_subscribe(msg, parsed_wuri.user, parsed_wuri.host);
}
示例#3
0
/**
 * handle RLS subscription
 */
int rls_handle_subscribe0(struct sip_msg* msg)
{
	struct to_body *pfrom;

	if (parse_from_uri(msg) < 0)
	{
		LM_ERR("failed to find From header\n");
		if (slb.freply(msg, 400, &pu_400_rpl) < 0)
		{
			LM_ERR("while sending 400 reply\n");
			return -1;
		}
		return 0;
	}
	pfrom = (struct to_body *) msg->from->parsed;
	
	return rls_handle_subscribe(msg, pfrom->parsed_uri.user,
			pfrom->parsed_uri.host);
}