summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorMark Spencer <markster@digium.com>2003-06-24 12:51:28 +0000
committerMark Spencer <markster@digium.com>2003-06-24 12:51:28 +0000
commit0e46787829d27727feff478fc50064f8dbd86634 (patch)
tree581c9d0756b4faa0109f2153084ceb6a1a568271 /channels
parent74a4fde52ec894116a889fa86c3be9cc141fd678 (diff)
Make names more rational
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1114 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rwxr-xr-xchannels/chan_sip.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 6a4f9b221..27932d4d4 100755
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -196,6 +196,7 @@ static struct sip_pvt {
struct sip_pvt *refer_call; /* Call we are referring */
struct sip_route *route; /* Head of linked list of routing steps (fm Record-Route) */
char remote_party_id[256];
+ char from[256];
char context[AST_MAX_EXTENSION];
char fromdomain[AST_MAX_EXTENSION]; /* Domain to show in the from field */
char fromuser[AST_MAX_EXTENSION]; /* Domain to show in the user field */
@@ -1094,7 +1095,14 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, char *title)
if (title)
snprintf(tmp->name, sizeof(tmp->name), "SIP/%s-%04x", title, rand() & 0xffff);
else
- snprintf(tmp->name, sizeof(tmp->name), "SIP/%s:%d", inet_ntoa(i->sa.sin_addr), ntohs(i->sa.sin_port));
+ if (strchr(i->from,':'))
+ {
+ snprintf(tmp->name, sizeof(tmp->name), "SIP/%s-%08x", strchr(i->from,':')+1, (int)(i));
+ }
+ else
+ {
+ snprintf(tmp->name, sizeof(tmp->name), "SIP/%s-%08x", i->from, (int)(i));
+ }
tmp->type = type;
if (i->dtmfmode & SIP_DTMF_INBAND) {
i->vad = ast_dsp_new();
@@ -1120,7 +1128,9 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, char *title)
tmp->pvt->transfer = sip_transfer;
tmp->pvt->fixup = sip_fixup;
tmp->pvt->send_digit = sip_senddigit;
+
tmp->pvt->bridge = ast_rtp_bridge;
+
tmp->callgroup = i->callgroup;
tmp->pickupgroup = i->pickupgroup;
if (strlen(i->accountcode))
@@ -2688,6 +2698,7 @@ static int transmit_refer(struct sip_pvt *p, char *dest)
of = get_header(&p->initreq, "From");
strncpy(from, of, sizeof(from) - 1);
of = ditch_braces(from);
+ strncpy(p->from,of,sizeof(p->from) - 1);
if (strncmp(of, "sip:", 4)) {
ast_log(LOG_NOTICE, "From address missing 'sip:', using it anyway\n");
} else
@@ -3630,11 +3641,11 @@ static int sip_show_channels(int fd, int argc, char *argv[])
return RESULT_SHOWUSAGE;
ast_pthread_mutex_lock(&iflock);
cur = iflist;
- ast_cli(fd, FORMAT2, "Peer", "Username", "Call ID", "Seq (Tx/Rx)", "Lag", "Jitter", "Format");
+ ast_cli(fd, FORMAT2, "Peer", "User/ANR", "Call ID", "Seq (Tx/Rx)", "Lag", "Jitter", "Format");
while (cur) {
if (!cur->subscribed) {
ast_cli(fd, FORMAT, inet_ntoa(cur->sa.sin_addr),
- strlen(cur->username) ? cur->username : "(None)",
+ strlen(cur->username) ? cur->username : ( strlen(cur->callerid) ? cur->callerid: "(None)" ),
cur->callid,
cur->ocseq, cur->icseq,
0,