mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-30 15:14:17 +00:00
Update to latest UniMRCP version. MRCP requests can no timeout if there is no server response.
This commit is contained in:
1 parent
0555b702db
commit
17099473a3
441 files changed
+17430
-17071
No files matched your search
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008 Arsen Chaloyan
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -12,6 +12,8 @@
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: consumer_task_suite.c 1474 2010-02-07 20:51:47Z achaloyan $
|
||||
*/
|
||||
|
||||
#include <apr_time.h>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008 Arsen Chaloyan
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -12,6 +12,8 @@
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: main.c 1539 2010-02-22 19:49:33Z achaloyan $
|
||||
*/
|
||||
|
||||
#include "apt_test_suite.h"
|
||||
@@ -19,6 +21,7 @@
|
||||
|
||||
apt_test_suite_t* task_test_suite_create(apr_pool_t *pool);
|
||||
apt_test_suite_t* consumer_task_test_suite_create(apr_pool_t *pool);
|
||||
apt_test_suite_t* multipart_test_suite_create(apr_pool_t *pool);
|
||||
|
||||
int main(int argc, const char * const *argv)
|
||||
{
|
||||
@@ -42,6 +45,9 @@ int main(int argc, const char * const *argv)
|
||||
test_suite = consumer_task_test_suite_create(pool);
|
||||
apt_test_framework_suite_add(test_framework,test_suite);
|
||||
|
||||
test_suite = multipart_test_suite_create(pool);
|
||||
apt_test_framework_suite_add(test_framework,test_suite);
|
||||
|
||||
/* run tests */
|
||||
apt_test_framework_run(test_framework,argc,argv);
|
||||
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
/*
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: multipart_suite.c 1673 2010-04-28 20:45:47Z achaloyan $
|
||||
*/
|
||||
|
||||
#include "apt_test_suite.h"
|
||||
#include "apt_multipart_content.h"
|
||||
#include "apt_log.h"
|
||||
|
||||
static apt_str_t* multipart_content_generate(apt_test_suite_t *suite)
|
||||
{
|
||||
apt_multipart_content_t *multipart = apt_multipart_content_create(1500,NULL,suite->pool);
|
||||
apt_str_t content_type;
|
||||
apt_str_t content;
|
||||
apt_str_t *body;
|
||||
|
||||
apt_string_set(&content_type,"text/plain");
|
||||
apt_string_set(&content,"This is the content of the first part");
|
||||
apt_multipart_content_add2(multipart,&content_type,NULL,&content);
|
||||
|
||||
apt_string_set(&content_type,"application/ssml+xml");
|
||||
apt_string_set(&content,
|
||||
"<?xml version=\"1.0\"?>\r\n"
|
||||
"<speak version=\"1.0\"\r\n"
|
||||
"<p> <s>You have 4 new messages.</s> </p>\r\n"
|
||||
"</speak>");
|
||||
apt_multipart_content_add2(multipart,&content_type,NULL,&content);
|
||||
|
||||
body = apt_multipart_content_finalize(multipart);
|
||||
if(body) {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Genereted Multipart Content [%lu bytes]\n%s",
|
||||
body->length,
|
||||
body->buf);
|
||||
}
|
||||
return body;
|
||||
}
|
||||
|
||||
static apt_bool_t multipart_content_parse(apt_test_suite_t *suite, apt_str_t *body)
|
||||
{
|
||||
apt_multipart_content_t *multipart = apt_multipart_content_assign(body,NULL,suite->pool);
|
||||
if(multipart) {
|
||||
apt_bool_t is_final;
|
||||
apt_content_part_t content_part;
|
||||
while(apt_multipart_content_get(multipart,&content_part,&is_final) == TRUE) {
|
||||
if(is_final == TRUE) {
|
||||
break;
|
||||
}
|
||||
if(content_part.type && apt_string_is_empty(content_part.type) == FALSE) {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Content Part Type: %.*s",
|
||||
content_part.type->length,
|
||||
content_part.type->buf);
|
||||
}
|
||||
if(content_part.id && apt_string_is_empty(content_part.id) == FALSE) {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Content Part Id: %.*s",
|
||||
content_part.id->length,
|
||||
content_part.id->buf);
|
||||
}
|
||||
if(content_part.length && apt_string_is_empty(content_part.length) == FALSE) {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Content Part Length: %.*s\n%.*s",
|
||||
content_part.length->length,
|
||||
content_part.length->buf,
|
||||
content_part.body.length,
|
||||
content_part.body.buf);
|
||||
}
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
static apt_bool_t multipart_test_run(apt_test_suite_t *suite, int argc, const char * const *argv)
|
||||
{
|
||||
apt_bool_t status = FALSE;
|
||||
apt_str_t *body = multipart_content_generate(suite);
|
||||
if(body) {
|
||||
status = multipart_content_parse(suite,body);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
apt_test_suite_t* multipart_test_suite_create(apr_pool_t *pool)
|
||||
{
|
||||
apt_test_suite_t *suite = apt_test_suite_create(pool,"multipart",NULL,multipart_test_run);
|
||||
return suite;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008 Arsen Chaloyan
|
||||
* Copyright 2008-2010 Arsen Chaloyan
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -12,6 +12,8 @@
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: task_suite.c 1474 2010-02-07 20:51:47Z achaloyan $
|
||||
*/
|
||||
|
||||
#include "apt_test_suite.h"
|
||||
|
||||
Reference in new issue
Block a user