summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Bryant <russell@russellbryant.com>2006-08-15 22:17:38 +0000
committerRussell Bryant <russell@russellbryant.com>2006-08-15 22:17:38 +0000
commit65373a19872f527bb23399015d79c4070a1b6d9c (patch)
tree998bd2c67cd3c4adb931613b5004757c30f669ae
parent8a0b9236a78d10a4389589443167d920b307be39 (diff)
reduce duplicated code by using print_codec_to_cli in sip_show_user as it is
already used in sip_show_peer (issue #7739, DEA) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@39932 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r--channels/chan_sip.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index d3f7df7b8..ca810f782 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -9686,7 +9686,6 @@ static int _sip_show_peer(int type, int fd, struct mansession *s, struct message
ast_cli(fd, "%s\n", codec_buf);
ast_cli(fd, " Codec Order : (");
print_codec_to_cli(fd, &peer->prefs);
-
ast_cli(fd, ")\n");
ast_cli(fd, " Status : ");
@@ -9789,9 +9788,8 @@ static int sip_show_user(int fd, int argc, char *argv[])
{
char cbuf[256];
struct sip_user *user;
- struct ast_codec_pref *pref;
struct ast_variable *v;
- int x = 0, codec = 0, load_realtime;
+ int load_realtime;
if (argc < 4)
return RESULT_SHOWUSAGE;
@@ -9821,18 +9819,7 @@ static int sip_show_user(int fd, int argc, char *argv[])
ast_cli(fd, " Callerid : %s\n", ast_callerid_merge(cbuf, sizeof(cbuf), user->cid_name, user->cid_num, "<unspecified>"));
ast_cli(fd, " ACL : %s\n", (user->ha?"Yes":"No"));
ast_cli(fd, " Codec Order : (");
- pref = &user->prefs;
- for(x = 0; x < 32 ; x++) {
- codec = ast_codec_pref_index(pref,x);
- if (!codec)
- break;
- ast_cli(fd, "%s", ast_getformatname(codec));
- if (x < 31 && ast_codec_pref_index(pref,x+1))
- ast_cli(fd, "|");
- }
-
- if (!x)
- ast_cli(fd, "none");
+ print_codec_to_cli(fd, &user->prefs);
ast_cli(fd, ")\n");
if (user->chanvars) {