In addition, this module implements an abstract interface for extensions and applications. A connected session's channel has one extension object which may have one or more applications linked into a stack which will be executed in order by the session's state machine when the current state is CS_EXECUTE.
Data Structures | |
| struct | switch_caller_profile |
| Call Specific Data. More... | |
| struct | switch_caller_application |
| An Abstract Representation of a dialplan Application. More... | |
| struct | switch_caller_extension |
| An Abstract Representation of a dialplan extension. More... | |
Functions | |
| switch_caller_extension_t * | switch_caller_extension_new (_In_ switch_core_session_t *session, _In_z_ const char *extension_name, _In_z_ const char *extension_number) |
| Create a new extension with desired parameters. | |
| switch_status_t | switch_caller_extension_clone (switch_caller_extension_t **new_ext, switch_caller_extension_t *orig, switch_memory_pool_t *pool) |
| void | switch_caller_extension_add_application (_In_ switch_core_session_t *session, _In_ switch_caller_extension_t *caller_extension, _In_z_ const char *application_name, _In_z_ const char *extra_data) |
| Add an application (instruction) to the given extension. | |
| _Check_return_ _Ret_opt_z_ const char * | switch_caller_get_field_by_name (_In_ switch_caller_profile_t *caller_profile, _In_z_ const char *name) |
| Get the value of a field in a caller profile based on it's name. | |
| switch_caller_profile_t * | switch_caller_profile_new (_In_ switch_memory_pool_t *pool, _In_opt_z_ const char *username, _In_opt_z_ const char *dialplan, _In_opt_z_ const char *caller_id_name, _In_opt_z_ const char *caller_id_number, _In_opt_z_ const char *network_addr, _In_opt_z_ const char *ani, _In_opt_z_ const char *aniii, _In_opt_z_ const char *rdnis, _In_opt_z_ const char *source, _In_opt_z_ const char *context, _In_opt_z_ const char *destination_number) |
| Create a new caller profile object. | |
| switch_caller_profile_t * | switch_caller_profile_clone (_In_ switch_core_session_t *session, _In_ switch_caller_profile_t *tocopy) |
| Clone an existing caller profile object. | |
| switch_caller_profile_t * | switch_caller_profile_dup (_In_ switch_memory_pool_t *pool, _In_ switch_caller_profile_t *tocopy) |
| Duplicate an existing caller profile object. | |
| void | switch_caller_profile_event_set_data (_In_ switch_caller_profile_t *caller_profile, _In_opt_z_ const char *prefix, _In_ switch_event_t *event) |
| Add headers to an existing event in regards to a specific profile. | |
|
||||||||||||||||||||
|
Add an application (instruction) to the given extension.
|
|
||||||||||||||||
|
00325 {
00326 switch_caller_extension_t *caller_extension = NULL;
00327 switch_caller_application_t *caller_application = NULL, *ap = NULL;
00328
00329 *new_ext = NULL;
00330
00331 if ((caller_extension = switch_core_alloc(pool, sizeof(switch_caller_extension_t))) != 0) {
00332 int match = 0;
00333
00334 caller_extension->extension_name = switch_core_strdup(pool, orig->extension_name);
00335 caller_extension->extension_number = switch_core_strdup(pool, orig->extension_number);
00336
00337 for(ap = orig->applications; ap; ap = ap->next) {
00338
00339 if (!match) {
00340 if (ap == orig->current_application) {
00341 match++;
00342 } else {
00343 continue;
00344 }
00345 }
00346 caller_application = switch_core_alloc(pool, sizeof(switch_caller_application_t));
00347
00348 caller_application->application_name = switch_core_strdup(pool, ap->application_name);
00349 caller_application->application_data = switch_core_strdup(pool, ap->application_data);
00350
00351 if (!caller_extension->applications) {
00352 caller_extension->applications = caller_application;
00353 } else if (caller_extension->last_application) {
00354 caller_extension->last_application->next = caller_application;
00355 }
00356
00357 caller_extension->last_application = caller_application;
00358
00359 if (ap == orig->current_application) {
00360 caller_extension->current_application = caller_application;
00361 }
00362 }
00363
00364 *new_ext = caller_extension;
00365
00366 return SWITCH_STATUS_SUCCESS;
00367 }
00368
00369
00370 return SWITCH_STATUS_MEMERR;
00371 }
|
|
||||||||||||||||
|
Create a new extension with desired parameters.
|
|
||||||||||||
|
Get the value of a field in a caller profile based on it's name.
|
|
||||||||||||
|
Clone an existing caller profile object.
|
|
||||||||||||
|
Duplicate an existing caller profile object.
|
|
||||||||||||||||
|
Add headers to an existing event in regards to a specific profile.
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Create a new caller profile object.
|
1.3.9.1