use "ChannelType" in events to indicate which channel driver that generates the event...
authorOlle Johansson <oej@edvina.net>
Mon, 9 Apr 2007 18:22:43 +0000 (18:22 +0000)
committerOlle Johansson <oej@edvina.net>
Mon, 9 Apr 2007 18:22:43 +0000 (18:22 +0000)
"ChannelDriver" and "Channel", previously used to indicate channel driver. ChannelType is more
in line with "core show channeltypes"

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@60987 65c4cc65-6c06-0410-ace0-fbb531ad65f3

CHANGES
channels/chan_iax2.c
channels/chan_sip.c

diff --git a/CHANGES b/CHANGES
index f0aeab7..014fc22 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -78,6 +78,9 @@ AMI - The manager (TCP/TLS/HTTP)
     Asterisk configuration file in JSON format.  This is intended to help
     improve the performance of AJAX applications using the manager interface
     over HTTP.
+  * SIP and IAX manager events now use "ChannelType" in all cases where we 
+    indicate channel driver. Previously, we used a mixture of "Channel"
+    and "ChannelDriver" headers.
 
 Dialplan functions
 ------------------
index ef5e653..2fa322f 100644 (file)
@@ -5509,7 +5509,7 @@ static int iax2_ack_registry(struct iax_ies *ies, struct sockaddr_in *sin, int c
                        snprintf(ourip, sizeof(ourip), "%s:%d", ast_inet_ntoa(reg->us.sin_addr), ntohs(reg->us.sin_port));
                        ast_verbose(VERBOSE_PREFIX_3 "Registered IAX2 to '%s', who sees us as %s%s\n", ast_inet_ntoa(sin->sin_addr), ourip, msgstatus);
                }
-               manager_event(EVENT_FLAG_SYSTEM, "Registry", "ChannelDriver: IAX2\r\nDomain: %s\r\nStatus: Registered\r\n", ast_inet_ntoa(sin->sin_addr));
+               manager_event(EVENT_FLAG_SYSTEM, "Registry", "ChannelType: IAX2\r\nDomain: %s\r\nStatus: Registered\r\n", ast_inet_ntoa(sin->sin_addr));
        }
        reg->regstate = REG_STATE_REGISTERED;
        return 0;
@@ -7542,7 +7542,7 @@ retryowner2:
                                if (iaxs[fr->callno]->reg) {
                                        if (authdebug) {
                                                ast_log(LOG_NOTICE, "Registration of '%s' rejected: '%s' from: '%s'\n", iaxs[fr->callno]->reg->username, ies.cause ? ies.cause : "<unknown>", ast_inet_ntoa(sin.sin_addr));
-                                               manager_event(EVENT_FLAG_SYSTEM, "Registry", "ChannelDriver: IAX2\r\nUsername: %s\r\nStatus: Rejected\r\nCause: %s\r\n", iaxs[fr->callno]->reg->username, ies.cause ? ies.cause : "<unknown>");
+                                               manager_event(EVENT_FLAG_SYSTEM, "Registry", "ChannelType: IAX2\r\nUsername: %s\r\nStatus: Rejected\r\nCause: %s\r\n", iaxs[fr->callno]->reg->username, ies.cause ? ies.cause : "<unknown>");
                                        }
                                        iaxs[fr->callno]->reg->regstate = REG_STATE_REJECTED;
                                }
index 9f68059..c5e5022 100644 (file)
@@ -7708,7 +7708,7 @@ static int sip_reg_timeout(void *data)
                r->timeout = -1;
                res=transmit_register(r, SIP_REGISTER, NULL, NULL);
        }
-       manager_event(EVENT_FLAG_SYSTEM, "Registry", "ChannelDriver: SIP\r\nUsername: %s\r\nDomain: %s\r\nStatus: %s\r\n", r->username, r->hostname, regstate2str(r->regstate));
+       manager_event(EVENT_FLAG_SYSTEM, "Registry", "ChannelType: SIP\r\nUsername: %s\r\nDomain: %s\r\nStatus: %s\r\n", r->username, r->hostname, regstate2str(r->regstate));
        registry_unref(r);
        return 0;
 }
@@ -12696,7 +12696,7 @@ static int handle_response_register(struct sip_pvt *p, int resp, char *rest, str
                        r->regstate = REG_STATE_UNREGISTERED;
                        transmit_register(r, SIP_REGISTER, NULL, NULL);
                }
-               manager_event(EVENT_FLAG_SYSTEM, "Registry", "ChannelDriver: SIP\r\nUsername: %s\r\nDomain: %s\r\nStatus: %s\r\n", r->username, r->hostname, regstate2str(r->regstate));
+               manager_event(EVENT_FLAG_SYSTEM, "Registry", "ChannelType: SIP\r\nUsername: %s\r\nDomain: %s\r\nStatus: %s\r\n", r->username, r->hostname, regstate2str(r->regstate));
                break;
        case 479:       /* SER: Not able to process the URI - address is wrong in register*/
                ast_log(LOG_WARNING, "Got error 479 on register to %s@%s, giving up (check config)\n", p->registry->username,p->registry->hostname);
@@ -12715,7 +12715,7 @@ static int handle_response_register(struct sip_pvt *p, int resp, char *rest, str
 
                r->regstate = REG_STATE_REGISTERED;
                r->regtime = time(NULL);                /* Reset time of last succesful registration */
-               manager_event(EVENT_FLAG_SYSTEM, "Registry", "ChannelDriver: SIP\r\nDomain: %s\r\nStatus: %s\r\n", r->hostname, regstate2str(r->regstate));
+               manager_event(EVENT_FLAG_SYSTEM, "Registry", "ChannelType: SIP\r\nDomain: %s\r\nStatus: %s\r\n", r->hostname, regstate2str(r->regstate));
                r->regattempts = 0;
                if (option_debug)
                        ast_log(LOG_DEBUG, "Registration successful\n");
@@ -17452,7 +17452,7 @@ static int reload_config(enum channelreloadreason reason)
        notify_types = ast_config_load(notify_config);
 
        /* Done, tell the manager */
-       manager_event(EVENT_FLAG_SYSTEM, "ChannelReload", "Channel: SIP\r\nReloadReason: %s\r\nRegistry_Count: %d\r\nPeer_Count: %d\r\nUser_Count: %d\r\n\r\n", channelreloadreason2txt(reason), registry_count, peer_count, user_count);
+       manager_event(EVENT_FLAG_SYSTEM, "ChannelReload", "ChannelType: SIP\r\nReloadReason: %s\r\nRegistry_Count: %d\r\nPeer_Count: %d\r\nUser_Count: %d\r\n\r\n", channelreloadreason2txt(reason), registry_count, peer_count, user_count);
 
        return 0;
 }