[svn-commits] qwell: branch qwell/http-channels-post r390670 - in /team/qwell/http-channels...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Jun 6 13:51:33 CDT 2013


Author: qwell
Date: Thu Jun  6 13:51:31 2013
New Revision: 390670

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=390670
Log:
Address feedback.

Modified:
    team/qwell/http-channels-post/res/stasis_http/resource_channels.c
    team/qwell/http-channels-post/res/stasis_http/resource_channels.h
    team/qwell/http-channels-post/rest-api/api-docs/channels.json

Modified: team/qwell/http-channels-post/res/stasis_http/resource_channels.c
URL: http://svnview.digium.com/svn/asterisk/team/qwell/http-channels-post/res/stasis_http/resource_channels.c?view=diff&rev=390670&r1=390669&r2=390670
==============================================================================
--- team/qwell/http-channels-post/res/stasis_http/resource_channels.c (original)
+++ team/qwell/http-channels-post/res/stasis_http/resource_channels.c Thu Jun  6 13:51:31 2013
@@ -321,7 +321,6 @@
 	char *caller_id = NULL;
 	char *cid_num = NULL;
 	char *cid_name = NULL;
-
 	int timeout = 30000;
 
 	const char *app = "Stasis";
@@ -339,6 +338,8 @@
 
 	if (args->timeout > 0) {
 		timeout = args->timeout * 1000;
+	} else if (args->timeout == -1) {
+		timeout = -1;
 	}
 
 	if (!ast_strlen_zero(args->endpoint)) {
@@ -366,19 +367,12 @@
 		caller_id = ast_strdupa(args->caller_id);
 		ast_callerid_parse(caller_id, &cid_name, &cid_num);
 
-		if (cid_num) {
+		if (ast_is_shrinkable_phonenumber(cid_num)) {
 			ast_shrink_phone_number(cid_num);
-
-			if (ast_strlen_zero(cid_num)) {
-				cid_num = NULL;
-			}
 		}
-		if (ast_strlen_zero(cid_name)) {
-			cid_name = NULL;
-		}
-	}
-
-	ast_log(LOG_DEBUG, "Dialing %s/%s\n", dialtech, dialdevice);
+	}
+
+	ast_debug(1, "Dialing %s/%s\n", dialtech, dialdevice);
 
 	/* originate a channel, putting it into an application */
 	if (ast_pbx_outgoing_app(dialtech, NULL, dialdevice, timeout, app, ast_str_buffer(appdata), NULL, 0, cid_num, cid_name, NULL, NULL, NULL)) {

Modified: team/qwell/http-channels-post/res/stasis_http/resource_channels.h
URL: http://svnview.digium.com/svn/asterisk/team/qwell/http-channels-post/res/stasis_http/resource_channels.h?view=diff&rev=390670&r1=390669&r2=390670
==============================================================================
--- team/qwell/http-channels-post/res/stasis_http/resource_channels.h (original)
+++ team/qwell/http-channels-post/res/stasis_http/resource_channels.h Thu Jun  6 13:51:31 2013
@@ -60,7 +60,7 @@
 	const char *context;
 	/*! \brief CallerID to use when dialing the endpoint or extension. */
 	const char *caller_id;
-	/*! \brief Timeout (in seconds), before giving up dialing. */
+	/*! \brief Timeout (in seconds) before giving up dialing, or -1 for no timeout. */
 	int timeout;
 	/*! \brief Application name to pass to the Stasis application. */
 	const char *app;

Modified: team/qwell/http-channels-post/rest-api/api-docs/channels.json
URL: http://svnview.digium.com/svn/asterisk/team/qwell/http-channels-post/rest-api/api-docs/channels.json?view=diff&rev=390670&r1=390669&r2=390670
==============================================================================
--- team/qwell/http-channels-post/rest-api/api-docs/channels.json (original)
+++ team/qwell/http-channels-post/rest-api/api-docs/channels.json Thu Jun  6 13:51:31 2013
@@ -57,11 +57,12 @@
 						},
 						{
 							"name": "timeout",
-							"description": "Timeout (in seconds), before giving up dialing.",
-							"paramType": "query",
-							"required": false,
-							"allowMultiple": false,
-							"dataType": "int"
+							"description": "Timeout (in seconds) before giving up dialing, or -1 for no timeout.",
+							"paramType": "query",
+							"required": false,
+							"allowMultiple": false,
+							"dataType": "int",
+							"defaultValue": 30
 						},
 						{
 							"name": "app",




More information about the svn-commits mailing list