[asterisk-commits] oej: branch oej/cancel_elsewhere_1.4 r286376 - in /team/oej/cancel_elsewhere_...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Sep 13 08:44:39 CDT 2010
Author: oej
Date: Mon Sep 13 08:44:32 2010
New Revision: 286376
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=286376
Log:
Resetting
Modified:
team/oej/cancel_elsewhere_1.4/ (props changed)
team/oej/cancel_elsewhere_1.4/apps/app_meetme.c
team/oej/cancel_elsewhere_1.4/apps/app_queue.c
team/oej/cancel_elsewhere_1.4/apps/app_voicemail.c
team/oej/cancel_elsewhere_1.4/channels/chan_dahdi.c
team/oej/cancel_elsewhere_1.4/channels/chan_sip.c
team/oej/cancel_elsewhere_1.4/configs/sip_notify.conf.sample
team/oej/cancel_elsewhere_1.4/doc/voicemail_odbc_postgresql.txt
team/oej/cancel_elsewhere_1.4/pbx/pbx_dundi.c
Propchange: team/oej/cancel_elsewhere_1.4/
------------------------------------------------------------------------------
automerge = http://www.codename-pineapple.org/
Propchange: team/oej/cancel_elsewhere_1.4/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Sep 13 08:44:32 2010
@@ -1,1 +1,1 @@
-/branches/1.4:1-271576
+/branches/1.4:1-272640
Modified: team/oej/cancel_elsewhere_1.4/apps/app_meetme.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/cancel_elsewhere_1.4/apps/app_meetme.c?view=diff&rev=286376&r1=286375&r2=286376
==============================================================================
--- team/oej/cancel_elsewhere_1.4/apps/app_meetme.c (original)
+++ team/oej/cancel_elsewhere_1.4/apps/app_meetme.c Mon Sep 13 08:44:32 2010
@@ -2873,10 +2873,11 @@
if (allowretry)
confno[0] = '\0';
} else {
- if ((!ast_strlen_zero(cnf->pin) &&
- !ast_test_flag(&confflags, CONFFLAG_ADMIN)) ||
+ if (((!ast_strlen_zero(cnf->pin) &&
+ !ast_test_flag(&confflags, CONFFLAG_ADMIN)) ||
(!ast_strlen_zero(cnf->pinadmin) &&
- ast_test_flag(&confflags, CONFFLAG_ADMIN))) {
+ ast_test_flag(&confflags, CONFFLAG_ADMIN))) &&
+ (!(cnf->users == 0 && cnf->isdynamic))) {
char pin[MAX_PIN] = "";
int j;
Modified: team/oej/cancel_elsewhere_1.4/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/cancel_elsewhere_1.4/apps/app_queue.c?view=diff&rev=286376&r1=286375&r2=286376
==============================================================================
--- team/oej/cancel_elsewhere_1.4/apps/app_queue.c (original)
+++ team/oej/cancel_elsewhere_1.4/apps/app_queue.c Mon Sep 13 08:44:32 2010
@@ -3309,6 +3309,20 @@
ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "TRANSFER", "%s|%s|%ld|%ld",
qe->chan->exten, qe->chan->context, (long) (callstart - qe->start),
(long) (time(NULL) - callstart));
+ if (qe->parent->eventwhencalled)
+ manager_event(EVENT_FLAG_AGENT, "AgentComplete",
+ "Queue: %s\r\n"
+ "Uniqueid: %s\r\n"
+ "Channel: %s\r\n"
+ "Member: %s\r\n"
+ "MemberName: %s\r\n"
+ "HoldTime: %ld\r\n"
+ "TalkTime: %ld\r\n"
+ "Reason: transfer\r\n"
+ "%s",
+ queuename, qe->chan->uniqueid, peer->name, member->interface, member->membername,
+ (long)(callstart - qe->start), (long)(time(NULL) - callstart),
+ qe->parent->eventwhencalled == QUEUE_EVENT_VARIABLES ? vars2manager(qe->chan, vars, sizeof(vars)) : "");
} else if (qe->chan->_softhangup) {
ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "COMPLETECALLER", "%ld|%ld|%d",
(long) (callstart - qe->start), (long) (time(NULL) - callstart), qe->opos);
@@ -3348,6 +3362,21 @@
ast_channel_datastore_remove(qe->chan, tds);
}
update_queue(qe->parent, member, callcompletedinsl);
+ } else {
+ if (qe->parent->eventwhencalled)
+ manager_event(EVENT_FLAG_AGENT, "AgentComplete",
+ "Queue: %s\r\n"
+ "Uniqueid: %s\r\n"
+ "Channel: %s\r\n"
+ "Member: %s\r\n"
+ "MemberName: %s\r\n"
+ "HoldTime: %ld\r\n"
+ "TalkTime: %ld\r\n"
+ "Reason: transfer\r\n"
+ "%s",
+ queuename, qe->chan->uniqueid, peer->name, member->interface, member->membername, (long)(callstart - qe->start),
+ (long)(time(NULL) - callstart),
+ qe->parent->eventwhencalled == QUEUE_EVENT_VARIABLES ? vars2manager(qe->chan, vars, sizeof(vars)) : "");
}
if (transfer_ds) {
Modified: team/oej/cancel_elsewhere_1.4/apps/app_voicemail.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/cancel_elsewhere_1.4/apps/app_voicemail.c?view=diff&rev=286376&r1=286375&r2=286376
==============================================================================
--- team/oej/cancel_elsewhere_1.4/apps/app_voicemail.c (original)
+++ team/oej/cancel_elsewhere_1.4/apps/app_voicemail.c Mon Sep 13 08:44:32 2010
@@ -1193,9 +1193,10 @@
fprintf(text_file_ptr, "%s\n", "[message]");
+ cid_name = get_header_by_tag(header_content, "X-Asterisk-VM-Caller-ID-Name:");
+ fprintf(text_file_ptr, "callerid=\"%s\" ", S_OR(cid_name, ""));
cid_num = get_header_by_tag(header_content, "X-Asterisk-VM-Caller-ID-Num:");
- cid_name = get_header_by_tag(header_content, "X-Asterisk-VM-Caller-ID-Name:");
- fprintf(text_file_ptr, "callerid=\"%s\" <%s>\n", S_OR(cid_name, ""), S_OR(cid_num, ""));
+ fprintf(text_file_ptr, "<%s>\n", S_OR(cid_num, ""));
context = get_header_by_tag(header_content, "X-Asterisk-VM-Context:");
fprintf(text_file_ptr, "context=%s\n", S_OR(context, ""));
origtime = get_header_by_tag(header_content, "X-Asterisk-VM-Orig-time:");
Modified: team/oej/cancel_elsewhere_1.4/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/cancel_elsewhere_1.4/channels/chan_dahdi.c?view=diff&rev=286376&r1=286375&r2=286376
==============================================================================
--- team/oej/cancel_elsewhere_1.4/channels/chan_dahdi.c (original)
+++ team/oej/cancel_elsewhere_1.4/channels/chan_dahdi.c Mon Sep 13 08:44:32 2010
@@ -6048,6 +6048,7 @@
ast_dsp_digitreset(p->dsp);
}
if (p->pri->overlapdial & DAHDI_OVERLAPDIAL_INCOMING) {
+ ast_mutex_lock(&p->lock);
if (p->pri->pri) {
if (!pri_grab(p, p->pri)) {
pri_proceeding(p->pri->pri, p->call, PVT_TO_CHANNEL(p), 0);
@@ -6057,6 +6058,7 @@
ast_log(LOG_WARNING, "Unable to grab PRI on span %d\n", p->span);
}
}
+ ast_mutex_unlock(&p->lock);
}
dahdi_enable_ec(p);
ast_setstate(chan, AST_STATE_RING);
Modified: team/oej/cancel_elsewhere_1.4/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/cancel_elsewhere_1.4/channels/chan_sip.c?view=diff&rev=286376&r1=286375&r2=286376
==============================================================================
--- team/oej/cancel_elsewhere_1.4/channels/chan_sip.c (original)
+++ team/oej/cancel_elsewhere_1.4/channels/chan_sip.c Mon Sep 13 08:44:32 2010
@@ -635,6 +635,7 @@
char *header[SIP_MAX_HEADERS];
char *line[SIP_MAX_LINES];
char data[SIP_MAX_PACKET];
+ char content[SIP_MAX_PACKET];
unsigned int sdp_start; /*!< the line number where the SDP begins */
unsigned int sdp_count; /*!< the number of lines of SDP */
AST_LIST_ENTRY(sip_request) next;
@@ -1561,8 +1562,8 @@
static void build_callid_registry(struct sip_registry *reg, struct in_addr ourip, const char *fromdomain);
static void make_our_tag(char *tagbuf, size_t len);
static int add_header(struct sip_request *req, const char *var, const char *value);
-static int add_header_contentLength(struct sip_request *req, int len);
-static int add_line(struct sip_request *req, const char *line);
+static int add_content(struct sip_request *req, const char *line);
+static int finalize_content(struct sip_request *req);
static int add_text(struct sip_request *req, const char *text);
static int add_digit(struct sip_request *req, char digit, unsigned int duration);
static int add_vidupdate(struct sip_request *req);
@@ -2378,6 +2379,7 @@
{
int res;
+ finalize_content(req);
add_blank(req);
if (sip_debug_test_pvt(p)) {
const struct sockaddr_in *dst = sip_real_dst(p);
@@ -2412,6 +2414,7 @@
{
int res;
+ finalize_content(req);
add_blank(req);
if (sip_debug_test_pvt(p)) {
if (ast_test_flag(&p->flags[0], SIP_NAT_ROUTE))
@@ -3698,6 +3701,7 @@
ast_clear_flag(&p->flags[0], SIP_NEEDDESTROY);
p->owner->tech_pvt = NULL;
p->owner = NULL; /* Owner will be gone after we return, so take it away */
+ ast_module_unref(ast_module_info->self);
return 0;
}
if (option_debug) {
@@ -6040,7 +6044,7 @@
/*! \brief Add header to SIP message */
static int add_header(struct sip_request *req, const char *var, const char *value)
{
- int maxlen = sizeof(req->data) - 4 - req->len; /* 4 bytes are for two \r\n ? */
+ int maxlen = sizeof(req->data) - 4 - req->len - strlen(req->content); /* 4 bytes are for two \r\n ? */
if (req->headers == SIP_MAX_HEADERS) {
ast_log(LOG_WARNING, "Out of SIP header space\n");
@@ -6070,35 +6074,42 @@
}
/*! \brief Add 'Content-Length' header to SIP message */
-static int add_header_contentLength(struct sip_request *req, int len)
+static int finalize_content(struct sip_request *req)
{
char clen[10];
- snprintf(clen, sizeof(clen), "%d", len);
- return add_header(req, "Content-Length", clen);
+ if (req->lines) {
+ ast_log(LOG_WARNING, "finalize_content() called on a message that has already been finalized\n");
+ return -1;
+ }
+
+ snprintf(clen, sizeof(clen), "%zd", strlen(req->content));
+ add_header(req, "Content-Length", clen);
+
+ if (!ast_strlen_zero(req->content)) {
+ snprintf(req->data + req->len, sizeof(req->data) - req->len, "\r\n%s", req->content);
+ req->len += strlen(req->data + req->len);
+ }
+
+ req->lines = !ast_strlen_zero(req->content);
+ return 0;
}
/*! \brief Add content (not header) to SIP message */
-static int add_line(struct sip_request *req, const char *line)
-{
- if (req->lines == SIP_MAX_LINES) {
- ast_log(LOG_WARNING, "Out of SIP line space\n");
+static int add_content(struct sip_request *req, const char *line)
+{
+ if (req->lines) {
+ ast_log(LOG_WARNING, "Can't add more content when the content has been finalized\n");
return -1;
}
- if (!req->lines) {
- /* Add extra empty return */
- snprintf(req->data + req->len, sizeof(req->data) - req->len, "\r\n");
- req->len += strlen(req->data + req->len);
- }
- if (req->len >= sizeof(req->data) - 4) {
+
+ if (req->len + strlen(req->content) + strlen(line) >= sizeof(req->data) - 4) {
ast_log(LOG_WARNING, "Out of space, can't add anymore\n");
return -1;
}
- req->line[req->lines] = req->data + req->len;
- snprintf(req->line[req->lines], sizeof(req->data) - req->len, "%s", line);
- req->len += strlen(req->line[req->lines]);
- req->lines++;
- return 0;
+
+ snprintf(req->content + strlen(req->content), sizeof(req->content) - strlen(req->content), "%s", line);
+ return 0;
}
/*! \brief Copy one header field from one request to another */
@@ -6551,7 +6562,6 @@
return -1;
}
respprep(&resp, p, msg, req);
- add_header_contentLength(&resp, 0);
/* If we are cancelling an incoming invite for some reason, add information
about the reason why we are doing this in clear text */
if (p->method == SIP_INVITE && msg[0] != '1' && p->owner && p->owner->hangupcause) {
@@ -6637,7 +6647,6 @@
respprep(&resp, p, msg, req);
append_date(&resp);
add_header(&resp, "Unsupported", unsupported);
- add_header_contentLength(&resp, 0);
return send_response(p, &resp, XMIT_UNRELIABLE, 0);
}
@@ -6667,7 +6676,6 @@
struct sip_request resp;
respprep(&resp, p, msg, req);
append_date(&resp);
- add_header_contentLength(&resp, 0);
return send_response(p, &resp, XMIT_UNRELIABLE, 0);
}
@@ -6677,7 +6685,6 @@
struct sip_request resp;
respprep(&resp, p, msg, req);
add_header(&resp, "Accept", "application/sdp");
- add_header_contentLength(&resp, 0);
return send_response(p, &resp, reliable, 0);
}
@@ -6697,7 +6704,6 @@
snprintf(tmp, sizeof(tmp), "Digest algorithm=MD5, realm=\"%s\", nonce=\"%s\"%s", global_realm, randdata, stale ? ", stale=true" : "");
respprep(&resp, p, msg, req);
add_header(&resp, header, tmp);
- add_header_contentLength(&resp, 0);
append_history(p, "AuthChal", "Auth challenge sent for %s - nc %d", p->username, p->noncecount);
return send_response(p, &resp, reliable, seqno);
}
@@ -6720,8 +6726,7 @@
{
/* XXX Convert \n's to \r\n's XXX */
add_header(req, "Content-Type", "text/plain");
- add_header_contentLength(req, strlen(text));
- add_line(req, text);
+ add_content(req, text);
return 0;
}
@@ -6733,8 +6738,7 @@
snprintf(tmp, sizeof(tmp), "Signal=%c\r\nDuration=%u\r\n", digit, duration);
add_header(req, "Content-Type", "application/dtmf-relay");
- add_header_contentLength(req, strlen(tmp));
- add_line(req, tmp);
+ add_content(req, tmp);
return 0;
}
@@ -6753,8 +6757,7 @@
" </vc_primitive>\r\n"
" </media_control>\r\n";
add_header(req, "Content-Type", "application/media_control+xml");
- add_header_contentLength(req, strlen(xml_is_a_huge_waste_of_space));
- add_line(req, xml_is_a_huge_waste_of_space);
+ add_content(req, xml_is_a_huge_waste_of_space);
return 0;
}
@@ -6868,7 +6871,6 @@
/*! \brief Add Session Description Protocol message */
static enum sip_result add_sdp(struct sip_request *resp, struct sip_pvt *p, int add_audio, int add_t38)
{
- int len = 0;
int alreadysent = 0;
struct sockaddr_in sin;
@@ -7137,45 +7139,35 @@
ast_build_string(&a_modem_next, &a_modem_left, "a=T38FaxUdpEC:%s\r\n", (p->t38.jointcapability & T38FAX_UDP_EC_REDUNDANCY) ? "t38UDPRedundancy" : "t38UDPFEC");
}
- len = strlen(version) + strlen(subject) + strlen(owner) + strlen(connection) + strlen(stime);
- if (add_audio)
- len += strlen(m_audio) + strlen(a_audio) + strlen(hold);
- if (needvideo) /* only if video response is appropriate */
- len += strlen(m_video) + strlen(a_video) + strlen(bandwidth) + strlen(hold);
- if (add_t38) {
- len += strlen(m_modem) + strlen(a_modem);
- }
-
add_header(resp, "Content-Type", "application/sdp");
- add_header_contentLength(resp, len);
- add_line(resp, version);
- add_line(resp, owner);
- add_line(resp, subject);
- add_line(resp, connection);
+ add_content(resp, version);
+ add_content(resp, owner);
+ add_content(resp, subject);
+ add_content(resp, connection);
if (needvideo) /* only if video response is appropriate */
- add_line(resp, bandwidth);
- add_line(resp, stime);
+ add_content(resp, bandwidth);
+ add_content(resp, stime);
if (add_audio) {
- add_line(resp, m_audio);
- add_line(resp, a_audio);
- add_line(resp, hold);
+ add_content(resp, m_audio);
+ add_content(resp, a_audio);
+ add_content(resp, hold);
} else if (p->offered_media[SDP_AUDIO].offered) {
snprintf(dummy_answer, sizeof(dummy_answer), "m=audio 0 RTP/AVP %s\r\n", p->offered_media[SDP_AUDIO].text);
- add_line(resp, dummy_answer);
+ add_content(resp, dummy_answer);
}
if (needvideo) { /* only if video response is appropriate */
- add_line(resp, m_video);
- add_line(resp, a_video);
- add_line(resp, hold); /* Repeat hold for the video stream */
+ add_content(resp, m_video);
+ add_content(resp, a_video);
+ add_content(resp, hold); /* Repeat hold for the video stream */
} else if (p->offered_media[SDP_VIDEO].offered) {
snprintf(dummy_answer, sizeof(dummy_answer), "m=video 0 RTP/AVP %s\r\n", p->offered_media[SDP_VIDEO].text);
- add_line(resp, dummy_answer);
+ add_content(resp, dummy_answer);
}
if (add_t38) {
- add_line(resp, m_modem);
- add_line(resp, a_modem);
+ add_content(resp, m_modem);
+ add_content(resp, a_modem);
} else if (p->offered_media[SDP_IMAGE].offered) {
- add_line(resp, "m=image 0 udptl t38\r\n");
+ add_content(resp, "m=image 0 udptl t38\r\n");
}
/* Update lastrtprx when we send our SDP */
@@ -7681,8 +7673,6 @@
add_sdp(&req, p, 0, 1);
} else if (p->rtp)
add_sdp(&req, p, 1, 0);
- } else {
- add_header_contentLength(&req, 0);
}
if (!p->initreq.headers || init > 2)
@@ -7867,8 +7857,7 @@
if (t > tmp + sizeof(tmp))
ast_log(LOG_WARNING, "Buffer overflow detected!! (Please file a bug report)\n");
- add_header_contentLength(&req, strlen(tmp));
- add_line(&req, tmp);
+ add_content(&req, tmp);
p->pendinginvite = p->ocseq; /* Remember that we have a pending NOTIFY in order not to confuse the NOTIFY subsystem */
return send_request(p, &req, XMIT_RELIABLE, p->ocseq);
@@ -7917,8 +7906,7 @@
if (t > tmp + sizeof(tmp))
ast_log(LOG_WARNING, "Buffer overflow detected!! (Please file a bug report)\n");
- add_header_contentLength(&req, strlen(tmp));
- add_line(&req, tmp);
+ add_content(&req, tmp);
if (!p->initreq.headers)
initialize_initreq(p, &req);
@@ -7948,8 +7936,7 @@
add_header(&req, "Supported", SUPPORTED_EXTENSIONS);
snprintf(tmp, sizeof(tmp), "SIP/2.0 %s\r\n", message);
- add_header_contentLength(&req, strlen(tmp));
- add_line(&req, tmp);
+ add_content(&req, tmp);
if (!p->initreq.headers)
initialize_initreq(p, &req);
@@ -8255,7 +8242,6 @@
add_header(&req, "Expires", tmp);
add_header(&req, "Contact", p->our_contact);
add_header(&req, "Event", "registration");
- add_header_contentLength(&req, 0);
initialize_initreq(p, &req);
if (sip_debug_test_pvt(p))
@@ -8426,7 +8412,6 @@
add_header(&resp, "X-Asterisk-HangupCauseCode", buf);
}
- add_header_contentLength(&resp, 0);
return send_request(p, &resp, reliable, seqno ? seqno : p->ocseq);
}
@@ -12156,8 +12141,15 @@
initreqprep(&req, p, SIP_NOTIFY);
- for (var = varlist; var; var = var->next)
+ for (var = varlist; var; var = var->next) {
+ if (!strcasecmp(var->name, "Content-Length")) {
+ if (option_debug >= 2) {
+ ast_log(LOG_DEBUG, "Ignoring pair %s=%s\n", var->name, var->value);
+ }
+ continue; /* ignore content-length, it is calculated automatically */
+ }
add_header(&req, var->name, ast_unescape_semicolon(var->value));
+ }
/* Recalculate our side, and recalculate Call ID */
if (ast_sip_ouraddrfor(&p->sa.sin_addr, &p->ourip))
Modified: team/oej/cancel_elsewhere_1.4/configs/sip_notify.conf.sample
URL: http://svnview.digium.com/svn/asterisk/team/oej/cancel_elsewhere_1.4/configs/sip_notify.conf.sample?view=diff&rev=286376&r1=286375&r2=286376
==============================================================================
--- team/oej/cancel_elsewhere_1.4/configs/sip_notify.conf.sample (original)
+++ team/oej/cancel_elsewhere_1.4/configs/sip_notify.conf.sample Mon Sep 13 08:44:32 2010
@@ -1,11 +1,9 @@
[polycom-check-cfg]
Event=>check-sync
-Content-Length=>0
; Untested
[sipura-check-cfg]
Event=>resync
-Content-Length=>0
; Untested
[grandstream-check-cfg]
@@ -14,9 +12,7 @@
; Untested
[cisco-check-cfg]
Event=>check-sync
-Content-Length=>0
; Tested
[snom-check-cfg]
Event=>check-sync\;reboot=false
-Content-Length=>0
Modified: team/oej/cancel_elsewhere_1.4/doc/voicemail_odbc_postgresql.txt
URL: http://svnview.digium.com/svn/asterisk/team/oej/cancel_elsewhere_1.4/doc/voicemail_odbc_postgresql.txt?view=diff&rev=286376&r1=286375&r2=286376
==============================================================================
--- team/oej/cancel_elsewhere_1.4/doc/voicemail_odbc_postgresql.txt (original)
+++ team/oej/cancel_elsewhere_1.4/doc/voicemail_odbc_postgresql.txt Mon Sep 13 08:44:32 2010
@@ -252,7 +252,7 @@
11) Just as a sanity check, make sure you check the voicemessages table via the
isql utility.
-[jsmith2 at localhost ODBC]$ echo "SELECT id, msgnum, dir, duration FROM voicemessages WHERE msgnum = 1" | isql testing
+[jsmith2 at localhost ODBC]$ echo "SELECT uniqueid, msgnum, dir, duration FROM voicemessages WHERE msgnum = 1" | isql testing
+---------------------------------------+
| Connected! |
| |
@@ -262,7 +262,7 @@
| |
+---------------------------------------+
SQL> +------------+------------+---------------------------------------------------------------------------------+---------------------+
-| id | msgnum | dir | duration |
+| uniqueid | msgnum | dir | duration |
+------------+------------+---------------------------------------------------------------------------------+---------------------+
+------------+------------+---------------------------------------------------------------------------------+---------------------+
SQLRowCount returns 0
@@ -370,9 +370,9 @@
\q to quit
asterisk=# SELECT * FROM voicemessages;
- id | msgnum | dir | context | macrocontext | callerid | origtime | duration | mailboxuser | mailboxcontext | recording | label | read | sip_id | pabx_id | iax_id
-----+--------+--------------------------------------------------+---------+--------------+-----------------------+------------+----------+-------------+----------------+-----------+-------+------+--------+---------+--------
- 26 | 0 | /var/spool/asterisk/voicemail/odbctest/101/INBOX | odbc | | "linksys" <linksys> | 1167794179 | 7 | 101 | odbctest | 16599 | | f | | |
+ uniqueid | msgnum | dir | context | macrocontext | callerid | origtime | duration | mailboxuser | mailboxcontext | recording | label | read | sip_id | pabx_id | iax_id
+----------+--------+--------------------------------------------------+---------+--------------+-----------------------+------------+----------+-------------+----------------+-----------+-------+------+--------+---------+--------
+ 26 | 0 | /var/spool/asterisk/voicemail/odbctest/101/INBOX | odbc | | "linksys" <linksys> | 1167794179 | 7 | 101 | odbctest | 16599 | | f | | |
(1 row)
Did you notice the the recording column is just a number? When a recording
Modified: team/oej/cancel_elsewhere_1.4/pbx/pbx_dundi.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/cancel_elsewhere_1.4/pbx/pbx_dundi.c?view=diff&rev=286376&r1=286375&r2=286376
==============================================================================
--- team/oej/cancel_elsewhere_1.4/pbx/pbx_dundi.c (original)
+++ team/oej/cancel_elsewhere_1.4/pbx/pbx_dundi.c Mon Sep 13 08:44:32 2010
@@ -2519,6 +2519,7 @@
ast_cli(fd, "Peer: %s\n", dundi_eid_to_str(eid_str, sizeof(eid_str), &peer->eid));
ast_cli(fd, "Model: %s\n", model2str(peer->model));
ast_cli(fd, "Host: %s\n", peer->addr.sin_addr.s_addr ? ast_inet_ntoa(peer->addr.sin_addr) : "<Unspecified>");
+ ast_cli(fd, "Port: %d\n", ntohs(peer->addr.sin_port));
ast_cli(fd, "Dynamic: %s\n", peer->dynamic ? "yes" : "no");
ast_cli(fd, "Reg: %s\n", peer->registerid < 0 ? "No" : "Yes");
ast_cli(fd, "In Key: %s\n", ast_strlen_zero(peer->inkey) ? "<None>" : peer->inkey);
@@ -2550,8 +2551,8 @@
static int dundi_show_peers(int fd, int argc, char *argv[])
{
-#define FORMAT2 "%-20.20s %-15.15s %-10.10s %-8.8s %-15.15s\n"
-#define FORMAT "%-20.20s %-15.15s %s %-10.10s %-8.8s %-15.15s\n"
+#define FORMAT2 "%-20.20s %-15.15s %-6.6s %-10.10s %-8.8s %-15.15s\n"
+#define FORMAT "%-20.20s %-15.15s %s %-6d %-10.10s %-8.8s %-15.15s\n"
struct dundi_peer *peer;
int registeredonly=0;
char avgms[20];
@@ -2570,7 +2571,7 @@
return RESULT_SHOWUSAGE;
}
AST_LIST_LOCK(&peers);
- ast_cli(fd, FORMAT2, "EID", "Host", "Model", "AvgTime", "Status");
+ ast_cli(fd, FORMAT2, "EID", "Host", "Port", "Model", "AvgTime", "Status");
AST_LIST_TRAVERSE(&peers, peer, list) {
char status[20];
int print_line = -1;
@@ -2605,7 +2606,7 @@
strcpy(avgms, "Unavail");
snprintf(srch, sizeof(srch), FORMAT, dundi_eid_to_str(eid_str, sizeof(eid_str), &peer->eid),
peer->addr.sin_addr.s_addr ? ast_inet_ntoa(peer->addr.sin_addr) : "(Unspecified)",
- peer->dynamic ? "(D)" : "(S)", model2str(peer->model), avgms, status);
+ peer->dynamic ? "(D)" : "(S)", ntohs(peer->addr.sin_port), model2str(peer->model), avgms, status);
if (argc == 5) {
if (!strcasecmp(argv[3],"include") && strstr(srch,argv[4])) {
@@ -2622,7 +2623,7 @@
if (print_line) {
ast_cli(fd, FORMAT, dundi_eid_to_str(eid_str, sizeof(eid_str), &peer->eid),
peer->addr.sin_addr.s_addr ? ast_inet_ntoa(peer->addr.sin_addr) : "(Unspecified)",
- peer->dynamic ? "(D)" : "(S)", model2str(peer->model), avgms, status);
+ peer->dynamic ? "(D)" : "(S)", ntohs(peer->addr.sin_port), model2str(peer->model), avgms, status);
}
}
ast_cli(fd, "%d dundi peers [%d online, %d offline, %d unmonitored]\n", total_peers, online_peers, offline_peers, unmonitored_peers);
@@ -4194,6 +4195,8 @@
ast_copy_string(peer->inkey, v->value, sizeof(peer->inkey));
} else if (!strcasecmp(v->name, "outkey")) {
ast_copy_string(peer->outkey, v->value, sizeof(peer->outkey));
+ } else if (!strcasecmp(v->name, "port")) {
+ peer->addr.sin_port = htons(atoi(v->value));
} else if (!strcasecmp(v->name, "host")) {
if (!strcasecmp(v->value, "dynamic")) {
peer->dynamic = 1;
More information about the asterisk-commits
mailing list