From 6407936c276a8a3cf0f01645bbef7e760e21685c Mon Sep 17 00:00:00 2001 From: Mark Spencer Date: Wed, 11 Jun 2003 12:24:13 +0000 Subject: [PATCH] manager unique id git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1083 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channel.c | 28 +++++++++++++++++----------- manager.c | 10 ++++++---- pbx.c | 5 +++-- 3 files changed, 26 insertions(+), 17 deletions(-) diff --git a/channel.c b/channel.c index 275eb2fe5b..3071113c3f 100755 --- a/channel.c +++ b/channel.c @@ -670,8 +670,9 @@ int ast_hangup(struct ast_channel *chan) ast_pthread_mutex_unlock(&chan->lock); manager_event(EVENT_FLAG_CALL, "Hangup", - "Channel: %s\r\n", - chan->name); + "Channel: %s\r\n" + "Uniqueid: %s\r\n", + chan->name, chan->uniqueid); ast_channel_free(chan); return res; } @@ -1491,8 +1492,9 @@ struct ast_channel *ast_request(char *type, int format, void *data) manager_event(EVENT_FLAG_CALL, "Newchannel", "Channel: %s\r\n" "State: %s\r\n" - "Callerid: %s\r\n", - c->name, ast_state2str(c->_state), c->callerid ? c->callerid : ""); + "Callerid: %s\r\n" + "Uniqueid: %s\r\n", + c->name, ast_state2str(c->_state), c->callerid ? c->callerid : "", c->uniqueid); } return c; } @@ -1775,7 +1777,7 @@ void ast_change_name(struct ast_channel *chan, char *newname) char tmp[256]; strncpy(tmp, chan->name, 256); strncpy(chan->name, newname, sizeof(chan->name) - 1); - manager_event(EVENT_FLAG_CALL, "Rename", "Oldname: %s\r\nNewname: %s\r\n", tmp, chan->name); + manager_event(EVENT_FLAG_CALL, "Rename", "Oldname: %s\r\nNewname: %s\r\nUniqueid: %s\r\n", tmp, chan->name, chan->uniqueid); } static int ast_do_masquerade(struct ast_channel *original) @@ -1960,9 +1962,11 @@ void ast_set_callerid(struct ast_channel *chan, char *callerid, int anitoo) ast_cdr_setcid(chan->cdr, chan); manager_event(EVENT_FLAG_CALL, "Newcallerid", "Channel: %s\r\n" - "Callerid: %s\r\n", + "Callerid: %s\r\n" + "Uniqueid: %s\r\n", chan->name, chan->callerid ? - chan->callerid : ""); + chan->callerid : "", + chan->uniqueid); } int ast_setstate(struct ast_channel *chan, int state) @@ -1975,14 +1979,16 @@ int ast_setstate(struct ast_channel *chan, int state) manager_event(EVENT_FLAG_CALL, "Newchannel", "Channel: %s\r\n" "State: %s\r\n" - "Callerid: %s\r\n", - chan->name, ast_state2str(chan->_state), chan->callerid ? chan->callerid : ""); + "Callerid: %s\r\n" + "Uniqueid: %s\r\n", + chan->name, ast_state2str(chan->_state), chan->callerid ? chan->callerid : "", chan->uniqueid); } else { manager_event(EVENT_FLAG_CALL, "Newstate", "Channel: %s\r\n" "State: %s\r\n" - "Callerid: %s\r\n", - chan->name, ast_state2str(chan->_state), chan->callerid ? chan->callerid : ""); + "Callerid: %s\r\n" + "Uniqueid: %s\r\n", + chan->name, ast_state2str(chan->_state), chan->callerid ? chan->callerid : "", chan->uniqueid); } } return 0; diff --git a/manager.c b/manager.c index 11293df8d0..741b9e4053 100755 --- a/manager.c +++ b/manager.c @@ -328,10 +328,11 @@ static int action_status(struct mansession *s, struct message *m) "Extension: %s\r\n" "Priority: %d\r\n" "%s" - "\r\n", + "\r\n" + "Uniqueid: %s\r\n", c->name, c->callerid ? c->callerid : "", ast_state2str(c->_state), c->context, - c->exten, c->priority, bridge); + c->exten, c->priority, bridge, c->uniqueid); } else { ast_cli(s->fd, "Event: Status\r\n" @@ -339,9 +340,10 @@ static int action_status(struct mansession *s, struct message *m) "CallerID: %s\r\n" "State: %s\r\n" "%s" - "\r\n", + "\r\n" + "Uniqueid: %s\r\n", c->name, c->callerid ? c->callerid : "", - ast_state2str(c->_state), bridge); + ast_state2str(c->_state), bridge, c->uniqueid); } c = ast_channel_walk(c); } diff --git a/pbx.c b/pbx.c index 9d7ea64b8e..a7bbf523f4 100755 --- a/pbx.c +++ b/pbx.c @@ -1670,8 +1670,9 @@ int ast_pbx_run(struct ast_channel *c) "Channel: %s\r\n" "Context: %s\r\n" "Extension: %s\r\n" - "Priority: %d\r\n", - c->name, c->context, c->exten, c->priority); + "Priority: %d\r\n" + "Uniqueid: %s\r\n", + c->name, c->context, c->exten, c->priority, c->uniqueid); if ((res = ast_spawn_extension(c, c->context, c->exten, c->priority, c->callerid))) { /* Something bad happened, or a hangup has been requested. */ if (((res >= '0') && (res <= '9')) || ((res >= 'A') && (res <= 'F')) ||