Index: channels/chan_sip.c =================================================================== --- channels/chan_sip.c (revision 312991) +++ channels/chan_sip.c (working copy) @@ -15997,8 +15997,8 @@ struct ao2_iterator i; /* the last argument is left-aligned, so we don't need a size anyways */ -#define FORMAT2 "%-25.25s %-39.39s %-3.3s %-10.10s %-3.3s %-8s %-10s %s\n" -#define FORMAT "%-25.25s %-39.39s %-3.3s %-3.3s %-3.3s %-8d %-10s %s\n" +#define FORMAT2 "%-25.25s %-39.39s %-3.3s %-10.10s %-3.3s %-8s %-11s %-32.32s %s\n" +#define FORMAT "%-25.25s %-39.39s %-3.3s %-10.10s %-3.3s %-8i %-11s %-32.32s %s\n" char name[256]; int total_peers = 0; @@ -16038,7 +16038,7 @@ } if (!s) /* Normal list */ - ast_cli(fd, FORMAT2, "Name/username", "Host", "Dyn", "Forcerport", "ACL", "Port", "Status", (realtimepeers ? "Realtime" : "")); + ast_cli(fd, FORMAT2, "Name/username", "Host", "Dyn", "Forcerport", "ACL", "Port", "Status", "Description", (realtimepeers ? "Realtime" : "")); i = ao2_iterator_init(peers, 0); @@ -16103,6 +16103,7 @@ ast_test_flag(&peer->flags[0], SIP_NAT_FORCE_RPORT) ? " N " : " ", /* NAT=yes? */ peer->ha ? " A " : " ", /* permit/deny */ ast_sockaddr_isnull(&peer->addr) ? 0 : ast_sockaddr_port(&peer->addr), status, + peer->description ? peer->description : "", realtimepeers ? (peer->is_realtime ? "Cached RT":"") : ""); if (!s) {/* Normal CLI list */ @@ -16112,7 +16113,9 @@ ast_test_flag(&peer->flags[0], SIP_NAT_FORCE_RPORT) ? " N " : " ", /* NAT=yes? */ peer->ha ? " A " : " ", /* permit/deny */ ast_sockaddr_isnull(&peer->addr) ? 0 : ast_sockaddr_port(&peer->addr), status, + peer->description ? peer->description : "", realtimepeers ? (peer->is_realtime ? "Cached RT":"") : ""); + } else { /* Manager format */ /* The names here need to be the same as other channels */ astman_append(s, @@ -16717,6 +16720,7 @@ struct ast_str *mailbox_str = ast_str_alloca(512); ast_cli(fd, "\n\n"); ast_cli(fd, " * Name : %s\n", peer->name); + ast_cli(fd, " Description : %s\n", peer->description); if (realtimepeers) { /* Realtime is enabled */ ast_cli(fd, " Realtime peer: %s\n", peer->is_realtime ? "Yes, cached" : "No"); } @@ -26105,6 +26109,7 @@ peer->call_limit=INT_MAX; ast_string_field_set(peer, vmexten, default_vmexten); ast_string_field_set(peer, secret, ""); + ast_string_field_set(peer, description, ""); ast_string_field_set(peer, remotesecret, ""); ast_string_field_set(peer, md5secret, ""); ast_string_field_set(peer, cid_num, ""); @@ -26347,6 +26352,8 @@ ast_string_field_set(peer, remotesecret, v->value); } else if (!strcasecmp(v->name, "secret")) { ast_string_field_set(peer, secret, v->value); + } else if (!strcasecmp(v->name, "description")) { + ast_string_field_set(peer, description, v->value); } else if (!strcasecmp(v->name, "md5secret")) { ast_string_field_set(peer, md5secret, v->value); } else if (!strcasecmp(v->name, "auth")) { @@ -29090,7 +29097,8 @@ MEMBER(sip_peer, maxms, AST_DATA_MILLISECONDS) \ MEMBER(sip_peer, qualifyfreq, AST_DATA_MILLISECONDS) \ MEMBER(sip_peer, timer_t1, AST_DATA_MILLISECONDS) \ - MEMBER(sip_peer, timer_b, AST_DATA_MILLISECONDS) + MEMBER(sip_peer, timer_b, AST_DATA_MILLISECONDS) \ + MEMBER(sip_peer, description, AST_DATA_STRING) AST_DATA_STRUCTURE(sip_peer, DATA_EXPORT_SIP_PEER); Index: channels/sip/include/sip.h =================================================================== --- channels/sip/include/sip.h (revision 312991) +++ channels/sip/include/sip.h (working copy) @@ -1157,6 +1157,7 @@ AST_DECLARE_STRING_FIELDS( AST_STRING_FIELD(secret); /*!< Password for inbound auth */ AST_STRING_FIELD(md5secret); /*!< Password in MD5 */ + AST_STRING_FIELD(description); /*!< Description of this peer */ AST_STRING_FIELD(remotesecret); /*!< Remote secret (trunks, remote devices) */ AST_STRING_FIELD(context); /*!< Default context for incoming calls */ AST_STRING_FIELD(subscribecontext); /*!< Default context for subscriptions */ Index: configs/sip.conf.sample =================================================================== --- configs/sip.conf.sample (revision 312991) +++ configs/sip.conf.sample (working copy) @@ -1100,6 +1100,7 @@ ; use_q850_reason ; maxforwards ; encryption +; description ; Used to provide a description of the peer in console output ;[sip_proxy] ; For incoming calls only. Example: FWD (Free World Dialup) @@ -1195,6 +1196,7 @@ ;context=from-sip ; Where to start in the dialplan when this phone calls ;callerid=John Doe <1234> ; Full caller ID, to override the phones config ; on incoming calls to Asterisk +;description=Courtesy Phone ; Description of the peer. Shown when doing 'sip show peers'. ;host=192.168.0.23 ; we have a static but private IP address ; No registration allowed ;nat=no ; there is not NAT between phone and Asterisk