add switch_caller_extension_add_application_printf()
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15688 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
f404011a70
commit
ce3ccb8da0
|
@ -161,6 +161,17 @@ SWITCH_DECLARE(void) switch_caller_extension_add_application(_In_ switch_core_se
|
|||
_In_ switch_caller_extension_t *caller_extension,
|
||||
_In_z_ const char *application_name, _In_z_ const char *extra_data);
|
||||
|
||||
/*!
|
||||
\brief Add an application (instruction) to the given extension
|
||||
\param session session associated with the extension (bound by scope)
|
||||
\param caller_extension extension to add the application to
|
||||
\param application_name the name of the application
|
||||
\param fmt optional argument to the application (printf format string)
|
||||
*/
|
||||
SWITCH_DECLARE(void) switch_caller_extension_add_application_printf(_In_ switch_core_session_t *session,
|
||||
_In_ switch_caller_extension_t *caller_extension,
|
||||
_In_z_ const char *application_name, _In_z_ const char *fmt, ...);
|
||||
|
||||
|
||||
/*!
|
||||
\brief Get the value of a field in a caller profile based on it's name
|
||||
|
|
|
@ -394,6 +394,25 @@ SWITCH_DECLARE(switch_caller_extension_t *) switch_caller_extension_new(switch_c
|
|||
return caller_extension;
|
||||
}
|
||||
|
||||
|
||||
SWITCH_DECLARE(void) switch_caller_extension_add_application_printf(switch_core_session_t *session,
|
||||
switch_caller_extension_t *caller_extension, const char *application_name,
|
||||
const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
char *data = NULL;
|
||||
|
||||
va_start(ap, fmt);
|
||||
switch_vasprintf(&data, fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
if (data) {
|
||||
switch_caller_extension_add_application(session, caller_extension, application_name, data);
|
||||
free(data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
SWITCH_DECLARE(void) switch_caller_extension_add_application(switch_core_session_t *session,
|
||||
switch_caller_extension_t *caller_extension, const char *application_name,
|
||||
const char *application_data)
|
||||
|
|
Loading…
Reference in New Issue