From: Kinsey Moore Date: Tue, 28 Jan 2014 19:13:30 +0000 (+0000) Subject: ARI: Make double subscribe respond with success X-Git-Tag: 12.1.0-rc1~3^2~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cfea265903a51e937f0ef6bb02efaecf5c195953;p=thirdparty%2Fasterisk.git ARI: Make double subscribe respond with success Currently, attempting to subscribe an application to a device state that it has already subscribed to will generate a 500 error response. This will now be treated as a subscription refresh even though ARI subscriptions don't currently support lifetimes and will respond with the normal response for a successful subscription (200 OK). (closes issue ASTERISK-23143) Reported by: Matt Jordan git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@406775 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/res/res_stasis_device_state.c b/res/res_stasis_device_state.c index 01b10d3eca..0130909ddc 100644 --- a/res/res_stasis_device_state.c +++ b/res/res_stasis_device_state.c @@ -326,8 +326,8 @@ static int subscribe_device_state(struct stasis_app *app, void *obj) ast_debug(3, "Subscribing to device %s", sub->device_name); if (is_subscribed_device_state(app, sub->device_name)) { - ast_log(LOG_WARNING, "Already subscribed to %s\n", sub->device_name); - return -1; + ast_debug(3, "App %s is already subscribed to %s\n", stasis_app_name(app), sub->device_name); + return 0; } if (!(sub->sub = stasis_subscribe(