mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-24 21:22:09 +00:00
add array manipulation to the wraper code
This commit is contained in:
@@ -390,12 +390,12 @@ bool ESLevent::setPriority(esl_priority_t priority)
|
||||
return false;
|
||||
}
|
||||
|
||||
const char *ESLevent::getHeader(const char *header_name)
|
||||
const char *ESLevent::getHeader(const char *header_name, int idx)
|
||||
{
|
||||
this_check("");
|
||||
|
||||
if (event) {
|
||||
return esl_event_get_header(event, header_name);
|
||||
return esl_event_get_header_idx(event, header_name, idx);
|
||||
} else {
|
||||
esl_log(ESL_LOG_ERROR, "Trying to getHeader an event that does not exist!\n");
|
||||
}
|
||||
@@ -415,6 +415,32 @@ bool ESLevent::addHeader(const char *header_name, const char *value)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ESLevent::pushHeader(const char *header_name, const char *value)
|
||||
{
|
||||
this_check(false);
|
||||
|
||||
if (event) {
|
||||
return esl_event_add_header_string(event, ESL_STACK_PUSH, header_name, value) == ESL_SUCCESS ? true : false;
|
||||
} else {
|
||||
esl_log(ESL_LOG_ERROR, "Trying to addHeader an event that does not exist!\n");
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ESLevent::unshiftHeader(const char *header_name, const char *value)
|
||||
{
|
||||
this_check(false);
|
||||
|
||||
if (event) {
|
||||
return esl_event_add_header_string(event, ESL_STACK_UNSHIFT, header_name, value) == ESL_SUCCESS ? true : false;
|
||||
} else {
|
||||
esl_log(ESL_LOG_ERROR, "Trying to addHeader an event that does not exist!\n");
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ESLevent::delHeader(const char *header_name)
|
||||
{
|
||||
this_check(false);
|
||||
|
||||
Reference in New Issue
Block a user