summaryrefslogtreecommitdiff
path: root/channels/sig_ss7.c
diff options
context:
space:
mode:
authorKinsey Moore <kmoore@digium.com>2012-07-20 15:48:55 +0000
committerKinsey Moore <kmoore@digium.com>2012-07-20 15:48:55 +0000
commitcb9756daa2042d6e5b91290def004b0f0c9eb168 (patch)
tree9ea585c25213ade435c83c95a055082f1e291f2a /channels/sig_ss7.c
parent499a445af213b1cbce99db9219f041ef053fbc18 (diff)
Add hangupcause translation support
The HANGUPCAUSE hash (trunk only) meant to replace SIP_CAUSE has now been replaced with the HANGUPCAUSE and HANGUPCAUSE_KEYS dialplan functions to better facilitate access to the AST_CAUSE translations for technology-specific cause codes. The HangupCauseClear application has also been added to remove this data from the channel. (closes issue SWP-4738) Review: https://reviewboard.asterisk.org/r/2025/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370316 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/sig_ss7.c')
-rw-r--r--channels/sig_ss7.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/channels/sig_ss7.c b/channels/sig_ss7.c
index 6abca5433..810a0d5f2 100644
--- a/channels/sig_ss7.c
+++ b/channels/sig_ss7.c
@@ -384,12 +384,13 @@ static void sig_ss7_queue_control(struct sig_ss7_linkset *ss7, int chanpos, int
*
* \return Nothing
*/
-static void ss7_queue_pvt_cause_data(struct ast_channel *owner, const char *cause)
+static void ss7_queue_pvt_cause_data(struct ast_channel *owner, const char *cause, int ast_cause)
{
struct ast_control_pvt_cause_code *cause_code;
int datalen = sizeof(*cause_code) + strlen(cause);
cause_code = alloca(datalen);
+ cause_code->ast_cause = ast_cause;
ast_copy_string(cause_code->chan_name, ast_channel_name(owner), AST_CHANNEL_NAME);
ast_copy_string(cause_code->code, cause, datalen + 1 - sizeof(*cause_code));
ast_queue_control_data(owner, AST_CONTROL_PVT_CAUSE_CODE, cause_code, datalen);
@@ -915,7 +916,7 @@ void *ss7_linkset(void *data)
sig_ss7_lock_owner(linkset, chanpos);
p->ss7call = NULL;
if (p->owner) {
- ss7_queue_pvt_cause_data(p->owner, "SS7 ISUP_EVENT_RSC");
+ ss7_queue_pvt_cause_data(p->owner, "SS7 ISUP_EVENT_RSC", AST_CAUSE_INTERWORKING);
ast_softhangup_nolock(p->owner, AST_SOFTHANGUP_DEV);
ast_channel_unlock(p->owner);
}
@@ -973,7 +974,7 @@ void *ss7_linkset(void *data)
}
p->call_level = SIG_SS7_CALL_LEVEL_GLARE;
if (p->owner) {
- ss7_queue_pvt_cause_data(p->owner, "SS7 ISUP_EVENT_IAM (glare)");
+ ss7_queue_pvt_cause_data(p->owner, "SS7 ISUP_EVENT_IAM (glare)", AST_CAUSE_NORMAL_CLEARING);
ast_channel_hangupcause_set(p->owner, AST_CAUSE_NORMAL_CLEARING);
ast_softhangup_nolock(p->owner, AST_SOFTHANGUP_DEV);
ast_channel_unlock(p->owner);
@@ -1119,7 +1120,7 @@ void *ss7_linkset(void *data)
sig_ss7_lock_owner(linkset, chanpos);
if (p->owner) {
snprintf(cause_str, sizeof(cause_str), "SS7 ISUP_EVENT_REL (%d)", e->rel.cause);
- ss7_queue_pvt_cause_data(p->owner, cause_str);
+ ss7_queue_pvt_cause_data(p->owner, cause_str, e->rel.cause);
ast_channel_hangupcause_set(p->owner, e->rel.cause);
ast_softhangup_nolock(p->owner, AST_SOFTHANGUP_DEV);