[asterisk-commits] rmudgett: branch rmudgett/ani r275666 - in /team/rmudgett/ani: ./ apps/ cdr/ ...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Jul 12 11:59:02 CDT 2010
Author: rmudgett
Date: Mon Jul 12 11:58:58 2010
New Revision: 275666
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=275666
Log:
Merged revisions 275664 via svnmerge from
https://origsvn.digium.com/svn/asterisk/team/rmudgett/cid
................
r275664 | rmudgett | 2010-07-12 11:50:18 -0500 (Mon, 12 Jul 2010) | 51 lines
Merged revisions 275466-275467,275509,275551,275587,275626 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r275466 | russell | 2010-07-10 09:44:18 -0500 (Sat, 10 Jul 2010) | 8 lines
Add support for devices with less than 3 lines on the LCD.
(closes issue #17600)
Reported by: minaguib
Patches:
ast_unistim_height_v2.patch uploaded by minaguib (license 1078)
Tested by: minaguib
........
r275467 | russell | 2010-07-10 09:48:03 -0500 (Sat, 10 Jul 2010) | 2 lines
Make indentation consistent, move some queue features to the queue section.
........
r275509 | eliel | 2010-07-10 15:49:30 -0500 (Sat, 10 Jul 2010) | 4 lines
When creating a conference for a unit test, it is not mandatory to open a
dahdi pseudo channel, so if we fail doing it, continue creating the conference.
........
r275551 | transnexus | 2010-07-11 23:16:18 -0500 (Sun, 11 Jul 2010) | 2 lines
Added support for indirect work mode.
........
r275587 | mmichelson | 2010-07-12 09:55:23 -0500 (Mon, 12 Jul 2010) | 8 lines
Allow netsock2.c to compile on systems that do not define AI_NUMERICSERV.
(closes issue #17617)
Reported by: pprindeville
Patches:
asterisk-trunk-bugid17617.patch uploaded by pprindeville (license 347)
........
r275626 | lmadsen | 2010-07-12 10:37:01 -0500 (Mon, 12 Jul 2010) | 11 lines
cdr_pgsql does not detect when a table is found.
This change adds an ERROR message to let you know when a failure exists to
get the columns from the pgsql database, which typically means that the
table does not exist.
(closes issue #17478)
Reported by: kobaz
Patches:
cdr_pgsql.patch uploaded by kobaz (license 834)
Tested by: kobaz, russell, lmadsen
........
................
Modified:
team/rmudgett/ani/ (props changed)
team/rmudgett/ani/CHANGES
team/rmudgett/ani/CREDITS
team/rmudgett/ani/apps/app_meetme.c
team/rmudgett/ani/apps/app_osplookup.c
team/rmudgett/ani/cdr/cdr_pgsql.c
team/rmudgett/ani/channels/chan_unistim.c
team/rmudgett/ani/configs/osp.conf.sample
team/rmudgett/ani/configs/unistim.conf.sample
team/rmudgett/ani/main/netsock2.c
Propchange: team/rmudgett/ani/
------------------------------------------------------------------------------
--- ani-integrated (original)
+++ ani-integrated Mon Jul 12 11:58:58 2010
@@ -1,1 +1,1 @@
-/team/rmudgett/cid:1-275506
+/team/rmudgett/cid:1-275664
Propchange: team/rmudgett/ani/
------------------------------------------------------------------------------
automerge = *
Propchange: team/rmudgett/ani/
------------------------------------------------------------------------------
--- cid-integrated (original)
+++ cid-integrated Mon Jul 12 11:58:58 2010
@@ -1,1 +1,1 @@
-/trunk:1-275451
+/trunk:1-275663
Modified: team/rmudgett/ani/CHANGES
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/ani/CHANGES?view=diff&rev=275666&r1=275665&r2=275666
==============================================================================
--- team/rmudgett/ani/CHANGES (original)
+++ team/rmudgett/ani/CHANGES Mon Jul 12 11:58:58 2010
@@ -93,12 +93,6 @@
------------
* Added 'p' option to PickupChan() to allow for picking up channel by the first
match to a partial channel name.
- * Added "ready" option to QUEUE_MEMBER counting to count free agents whose wrap-up
- timeout has expired.
- * Added 'R' option to app_queue. This option stops moh and indicates ringing
- to the caller when an Agent's phone is ringing. This can be used to indicate
- to the caller that their call is about to be picked up, which is nice when
- one has been on hold for an extened period of time.
* Added .m3u support for Mp3Player application.
* Added progress option to the app_dial D() option. When progress DTMF is
present, those values are sent immediately upon receiving a PROGRESS message
@@ -253,57 +247,63 @@
Queue changes
-------------
- * A new config option, penaltymemberslimit, has been added to queues.conf.
- When set this option will disregard penalty settings when a queue has too
- few members.
- * A new option, 'I' has been added to both app_queue and app_dial.
- By setting this option, Asterisk will not update the caller with
- connected line changes or redirecting party changes when they occur.
- * A 'relative-peroidic-announce' option has been added to queues.conf. When
- enabled, this option will cause periodic announce times to be calculated
- from the end of announcements rather than from the beginning.
- * The autopause option in queues.conf can be passed a new value, "all." The
- result is that if a member becomes auto-paused, he will be paused in all
- queues for which he is a member, not just the queue that failed to reach
- the member.
+ * Added "ready" option to QUEUE_MEMBER counting to count free agents whose wrap-up
+ timeout has expired.
+ * Added 'R' option to app_queue. This option stops moh and indicates ringing
+ to the caller when an Agent's phone is ringing. This can be used to indicate
+ to the caller that their call is about to be picked up, which is nice when
+ one has been on hold for an extened period of time.
+ * A new config option, penaltymemberslimit, has been added to queues.conf.
+ When set this option will disregard penalty settings when a queue has too
+ few members.
+ * A new option, 'I' has been added to both app_queue and app_dial.
+ By setting this option, Asterisk will not update the caller with
+ connected line changes or redirecting party changes when they occur.
+ * A 'relative-peroidic-announce' option has been added to queues.conf. When
+ enabled, this option will cause periodic announce times to be calculated
+ from the end of announcements rather than from the beginning.
+ * The autopause option in queues.conf can be passed a new value, "all." The
+ result is that if a member becomes auto-paused, he will be paused in all
+ queues for which he is a member, not just the queue that failed to reach
+ the member.
mISDN channel driver (chan_misdn) changes
----------------------------------------
- * Added display_connected parameter to misdn.conf to put a display string
- in the CONNECT message containing the connected name and/or number if
- the presentation setting permits it.
- * Added display_setup parameter to misdn.conf to put a display string
- in the SETUP message containing the caller name and/or number if the
- presentation setting permits it.
- * Made misdn.conf parameters localdialplan and cpndialplan take a -1 to
- indicate the dialplan settings are to be obtained from the asterisk
- channel.
- * Made misdn.conf parameter callerid accept the "name" <number> format
- used by the rest of the system.
- * Made use the nationalprefix and internationalprefix misdn.conf
- parameters to prefix any received number from the ISDN link if that
- number has the corresponding Type-Of-Number. NOTE: This includes
- comparing the incoming call's dialed number against the MSN list.
- * Added the following new parameters: unknownprefix, netspecificprefix,
- subscriberprefix, and abbreviatedprefix in misdn.conf to prefix any
- received number from the ISDN link if that number has the corresponding
- Type-Of-Number.
- * Added new dialplan application misdn_command which permits controlling
- the CCBS/CCNR functionality.
- * Added new dialplan function mISDN_CC which permits retrieval of various
- values from an active call completion record.
- * For PTP, you should manually send the COLR of the redirected-to party
- for an incomming redirected call if the incoming call could experience
- further redirects. Just set the REDIRECTING(to-num,i) = ${EXTEN} and
- set the REDIRECTING(to-pres) to the COLR. A call has been redirected
- if the REDIRECTING(from-num) is not empty.
- * For outgoing PTP redirected calls, you now need to use the inhibit(i)
- option on all of the REDIRECTING statements before dialing the
- redirected-to party. You still have to set the REDIRECTING(to-xxx,i)
- and the REDIRECTING(from-xxx,i) values. The PTP call will update the
- redirecting-to presentation (COLR) when it becomes available.
- * Added outgoing_colp parameter to misdn.conf to filter outgoing COLP
- information.
+ * Added display_connected parameter to misdn.conf to put a display string
+ in the CONNECT message containing the connected name and/or number if
+ the presentation setting permits it.
+ * Added display_setup parameter to misdn.conf to put a display string
+ in the SETUP message containing the caller name and/or number if the
+ presentation setting permits it.
+ * Made misdn.conf parameters localdialplan and cpndialplan take a -1 to
+ indicate the dialplan settings are to be obtained from the asterisk
+ channel.
+ * Made misdn.conf parameter callerid accept the "name" <number> format
+ used by the rest of the system.
+ * Made use the nationalprefix and internationalprefix misdn.conf
+ parameters to prefix any received number from the ISDN link if that
+ number has the corresponding Type-Of-Number. NOTE: This includes
+ comparing the incoming call's dialed number against the MSN list.
+ * Added the following new parameters: unknownprefix, netspecificprefix,
+ subscriberprefix, and abbreviatedprefix in misdn.conf to prefix any
+ received number from the ISDN link if that number has the corresponding
+ Type-Of-Number.
+ * Added new dialplan application misdn_command which permits controlling
+ the CCBS/CCNR functionality.
+ * Added new dialplan function mISDN_CC which permits retrieval of various
+ values from an active call completion record.
+ * For PTP, you should manually send the COLR of the redirected-to party
+ for an incomming redirected call if the incoming call could experience
+ further redirects. Just set the REDIRECTING(to-num,i) = ${EXTEN} and
+ set the REDIRECTING(to-pres) to the COLR. A call has been redirected
+ if the REDIRECTING(from-num) is not empty.
+ * For outgoing PTP redirected calls, you now need to use the inhibit(i)
+ option on all of the REDIRECTING statements before dialing the
+ redirected-to party. You still have to set the REDIRECTING(to-xxx,i)
+ and the REDIRECTING(from-xxx,i) values. The PTP call will update the
+ redirecting-to presentation (COLR) when it becomes available.
+ * Added outgoing_colp parameter to misdn.conf to filter outgoing COLP
+ information.
thirdparty mISDN enhancements
-----------------------------
@@ -513,7 +513,8 @@
* The addition of G.719 pass-through support.
* Added support for 16khz Speex audio. This can be enabled by using 'allow=speex16'
during device configuration.
-
+ * The UNISTIM channel driver (chan_unistim) has been updated to support devices that
+ have less than 3 lines on the LCD.
CLI Changes
-----------
Modified: team/rmudgett/ani/CREDITS
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/ani/CREDITS?view=diff&rev=275666&r1=275665&r2=275666
==============================================================================
--- team/rmudgett/ani/CREDITS (original)
+++ team/rmudgett/ani/CREDITS Mon Jul 12 11:58:58 2010
@@ -174,6 +174,8 @@
Cedric Hans - Development of chan_unistim
cedric.hans(AT)mlkj.net
+Takao Takahashi & Mina Naguib - chan_unistim improvements for smaller devices
+
Sergio Fadda - console_video: video support for chan_oss and chan_alsa
Marta Carbone - console_video and the astobj2 framework
Modified: team/rmudgett/ani/apps/app_meetme.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/ani/apps/app_meetme.c?view=diff&rev=275666&r1=275665&r2=275666
==============================================================================
--- team/rmudgett/ani/apps/app_meetme.c (original)
+++ team/rmudgett/ani/apps/app_meetme.c Mon Jul 12 11:58:58 2010
@@ -1186,14 +1186,18 @@
cnf->fd = open("/dev/dahdi/pseudo", O_RDWR);
if (cnf->fd < 0 || ioctl(cnf->fd, DAHDI_SETCONF, &dahdic)) {
if (test) {
+ /* if we are creating a conference for a unit test, it is not neccesary
+ * to open a pseudo channel, so, if we fail continue creating
+ * the conference. */
ast_test_status_update(test, "Unable to open pseudo device\n");
- }
- ast_log(LOG_WARNING, "Unable to open pseudo device\n");
- if (cnf->fd >= 0)
- close(cnf->fd);
- ast_free(cnf);
- cnf = NULL;
- goto cnfout;
+ } else {
+ ast_log(LOG_WARNING, "Unable to open pseudo device\n");
+ if (cnf->fd >= 0)
+ close(cnf->fd);
+ ast_free(cnf);
+ cnf = NULL;
+ goto cnfout;
+ }
}
cnf->dahdiconf = dahdic.confno;
Modified: team/rmudgett/ani/apps/app_osplookup.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/ani/apps/app_osplookup.c?view=diff&rev=275666&r1=275665&r2=275666
==============================================================================
--- team/rmudgett/ani/apps/app_osplookup.c (original)
+++ team/rmudgett/ani/apps/app_osplookup.c Mon Jul 12 11:58:58 2010
@@ -131,6 +131,9 @@
<para>Looks up destination via OSP.</para>
<para>Input variables:</para>
<variablelist>
+ <variable name="OSPINACTUALSRC">
+ <para>The actual source device IP address in indirect mode.</para>
+ </variable>
<variable name="OSPINPEERIP">
<para>The last hop IP address.</para>
</variable>
@@ -459,6 +462,12 @@
OSP_AUTH_NO = 0, /* Accept any call */
OSP_AUTH_YES, /* Accept call with valid OSP token or without OSP token */
OSP_AUTH_EXC /* Only accept call with valid OSP token */
+};
+
+/* OSP Work Mode */
+enum osp_workmode {
+ OSP_MODE_DIRECT= 0, /* Direct */
+ OSP_MODE_INDIRECT /* Indirect */
};
/* OSP Service Type */
@@ -501,6 +510,7 @@
#define OSP_DEF_MAXDESTS ((unsigned int)5) /* OSP default max number of destinations */
#define OSP_DEF_TIMELIMIT ((unsigned int)0) /* OSP default duration limit, no limit */
#define OSP_DEF_PROTOCOL OSP_PROT_SIP /* OSP default destination protocol, SIP */
+#define OSP_DEF_WORKMODE OSP_MODE_DIRECT /* OSP default work mode, direct */
#define OSP_DEF_SRVTYPE OSP_SRV_VOICE /* OSP default service type, voice */
#define OSP_MAX_CUSTOMINFO ((unsigned int)8) /* OSP max number of custom info */
#define OSP_DEF_INTSTATS ((int)-1) /* OSP default int statistic */
@@ -523,7 +533,8 @@
char source[OSP_SIZE_NORSTR]; /* IP of self */
enum osp_authpolicy authpolicy; /* OSP authentication policy */
const char* defprotocol; /* OSP default destination protocol */
- enum osp_srvtype srvtype; /* OSP default service type */
+ enum osp_workmode workmode; /* OSP work mode */
+ enum osp_srvtype srvtype; /* OSP service type */
struct osp_provider* next; /* Pointer to next OSP provider */
};
@@ -645,6 +656,7 @@
provider->timeout = OSP_DEF_TIMEOUT;
provider->authpolicy = OSP_DEF_AUTHPOLICY;
provider->defprotocol = OSP_DEF_PROTOCOL;
+ provider->workmode = OSP_DEF_WORKMODE;
provider->srvtype = OSP_DEF_SRVTYPE;
for (var = ast_variable_browse(cfg, name); var != NULL; var = var->next) {
@@ -747,6 +759,14 @@
} else {
ast_log(LOG_WARNING, "OSP: default protocol should be %s, %s, %s or %s not '%s' at line %d\n",
OSP_PROT_SIP, OSP_PROT_H323, OSP_PROT_IAX, OSP_PROT_SKYPE, var->value, var->lineno);
+ }
+ } else if (!strcasecmp(var->name, "workmode")) {
+ if ((sscanf(var->value, "%30d", &num) == 1) && ((num == OSP_MODE_DIRECT) || (num == OSP_MODE_INDIRECT))) {
+ provider->workmode = num;
+ ast_debug(1, "OSP: workmode '%d'\n", num);
+ } else {
+ ast_log(LOG_WARNING, "OSP: workmode should be %d or %d, not '%s' at line %d\n",
+ OSP_MODE_DIRECT, OSP_MODE_INDIRECT, var->value, var->lineno);
}
} else if (!strcasecmp(var->name, "servicetype")) {
if ((sscanf(var->value, "%30d", &num) == 1) && ((num == OSP_SRV_VOICE) || (num == OSP_SRV_NPQUERY))) {
@@ -879,7 +899,7 @@
int res = OSP_FAILED;
struct osp_provider* p;
- *provider = NULL;
+ *provider = NULL;
ast_mutex_lock(&osp_lock);
for (p = osp_providers; p != NULL; p = p->next) {
@@ -1186,7 +1206,7 @@
if (error != OSPC_ERR_NO_ERROR) {
ast_debug(1, "OSP: Unable to get operator name of type '%d', error '%d'\n", type, error);
results->opname[type][0] = '\0';
- }
+ }
}
if ((error = OSPPTransactionGetDestProtocol(results->outhandle, &protocol)) != OSPC_ERR_NO_ERROR) {
@@ -1443,6 +1463,7 @@
* \brief OSP Lookup function
* \param name OSP provider context name
* \param callidtypes Call ID types
+ * \param actualsrc Actual source device in indirect mode
* \param srcdev Source device of outbound call
* \param calling Calling number
* \param called Called number
@@ -1456,6 +1477,7 @@
static int osp_lookup(
const char* name,
unsigned int callidtypes,
+ const char* actualsrc,
const char* srcdev,
const char* calling,
const char* called,
@@ -1556,8 +1578,18 @@
}
}
- osp_convert_inout(source, src, sizeof(src));
- osp_convert_inout(srcdev, dev, sizeof(dev));
+ if (provider->workmode == OSP_MODE_INDIRECT) {
+ osp_convert_inout(srcdev, src, sizeof(src));
+ if (ast_strlen_zero(actualsrc)) {
+ osp_convert_inout(srcdev, dev, sizeof(dev));
+ } else {
+ osp_convert_inout(actualsrc, dev, sizeof(dev));
+ }
+ } else {
+ osp_convert_inout(source, src, sizeof(src));
+ osp_convert_inout(srcdev, dev, sizeof(dev));
+ }
+
if (provider->srvtype == OSP_SRV_NPQUERY) {
OSPPTransactionSetServiceType(results->outhandle, OSPC_SERVICE_NPQUERY);
if (!ast_strlen_zero(dest)) {
@@ -2272,6 +2304,7 @@
unsigned int callidtypes = OSP_CALLID_UNDEF;
struct varshead* headp;
struct ast_var_t* current;
+ const char* actualsrc = "";
const char* srcdev = "";
const char* snetid = "";
struct osp_npdata np;
@@ -2338,7 +2371,9 @@
headp = &chan->varshead;
AST_LIST_TRAVERSE(headp, current, entries) {
- if (!strcasecmp(ast_var_name(current), "OSPINPEERIP")) {
+ if (!strcasecmp(ast_var_name(current), "OSPINACTUALSRC")) {
+ actualsrc = ast_var_value(current);
+ } else if (!strcasecmp(ast_var_name(current), "OSPINPEERIP")) {
srcdev = ast_var_value(current);
} else if (!strcasecmp(ast_var_name(current), "OSPINHANDLE")) {
if (sscanf(ast_var_value(current), "%30d", &results.inhandle) != 1) {
@@ -2394,6 +2429,7 @@
cinfo[7] = ast_var_value(current);
}
}
+ ast_debug(1, "OSPLookup: actual source device '%s'\n", actualsrc);
ast_debug(1, "OSPLookup: source device '%s'\n", srcdev);
ast_debug(1, "OSPLookup: OSPINHANDLE '%d'\n", results.inhandle);
ast_debug(1, "OSPLookup: OSPINTIMELIMIT '%d'\n", results.intimelimit);
@@ -2420,7 +2456,7 @@
return OSP_AST_ERROR;
}
- res = osp_lookup(provider, callidtypes, srcdev,
+ res = osp_lookup(provider, callidtypes, actualsrc, srcdev,
S_COR(chan->caller.id.XXX_number.valid, chan->caller.id.XXX_number.str, NULL),
args.exten, snetid, &np, &div, cinfo, &results);
if (res > 0) {
@@ -2908,7 +2944,7 @@
osp_security = 1;
}
ast_debug(1, "OSP: osp_security '%d'\n", osp_security);
-
+
if ((cvar = ast_variable_retrieve(cfg, OSP_GENERAL_CAT, "tokenformat"))) {
if ((sscanf(cvar, "%30d", &ivar) == 1) &&
((ivar == TOKEN_ALGO_SIGNED) || (ivar == TOKEN_ALGO_UNSIGNED) || (ivar == TOKEN_ALGO_BOTH)))
@@ -3010,6 +3046,7 @@
ast_cli(a->fd, "Source: %s\n", strlen(provider->source) ? provider->source : "<unspecified>");
ast_cli(a->fd, "Auth Policy %d\n", provider->authpolicy);
ast_cli(a->fd, "Default protocol %s\n", provider->defprotocol);
+ ast_cli(a->fd, "Work mode %d\n", provider->workmode);
ast_cli(a->fd, "Service type %d\n", provider->srvtype);
ast_cli(a->fd, "OSP Handle: %d\n", provider->handle);
found++;
Modified: team/rmudgett/ani/cdr/cdr_pgsql.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/ani/cdr/cdr_pgsql.c?view=diff&rev=275666&r1=275665&r2=275666
==============================================================================
--- team/rmudgett/ani/cdr/cdr_pgsql.c (original)
+++ team/rmudgett/ani/cdr/cdr_pgsql.c Mon Jul 12 11:58:58 2010
@@ -526,6 +526,13 @@
}
rows = PQntuples(result);
+ if (rows == 0) {
+ ast_log(LOG_ERROR, "cdr_pgsql: Failed to query database columns. No columns found, does the table exist?\n");
+ PQclear(result);
+ unload_module();
+ return AST_MODULE_LOAD_DECLINE;
+ }
+
for (i = 0; i < rows; i++) {
fname = PQgetvalue(result, i, 0);
ftype = PQgetvalue(result, i, 1);
Modified: team/rmudgett/ani/channels/chan_unistim.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/ani/channels/chan_unistim.c?view=diff&rev=275666&r1=275665&r2=275666
==============================================================================
--- team/rmudgett/ani/channels/chan_unistim.c (original)
+++ team/rmudgett/ani/channels/chan_unistim.c Mon Jul 12 11:58:58 2010
@@ -76,6 +76,7 @@
#define DEFAULTCONTEXT "default"
#define DEFAULTCALLERID "Unknown"
#define DEFAULTCALLERNAME " "
+#define DEFAULTHEIGHT 3
#define USTM_LOG_DIR "unistimHistory"
/*! Size of the transmit buffer */
@@ -433,6 +434,7 @@
char softkeyicon[6]; /*!< icon number */
char softkeydevice[6][16]; /*!< name of the device monitored */
struct unistim_device *sp[6]; /*!< pointer to the device monitored by this soft key */
+ int height; /*!< The number of lines the phone can display */
char maintext0[25]; /*!< when the phone is idle, display this string on line 0 */
char maintext1[25]; /*!< when the phone is idle, display this string on line 1 */
char maintext2[25]; /*!< when the phone is idle, display this string on line 2 */
@@ -2280,11 +2282,21 @@
pte->device->size_phone_number = 15;
strcpy(tmp, "Number : ...............");
memcpy(tmp + 9, pte->device->phone_number, pte->device->size_phone_number);
- send_text(TEXT_LINE2, TEXT_NORMAL, pte, tmp);
- send_blink_cursor(pte);
- send_cursor_pos(pte,
+
+ if (pte->device->height == 1) {
+ send_text(TEXT_LINE0, TEXT_NORMAL, pte, tmp);
+ send_blink_cursor(pte);
+ send_cursor_pos(pte,
+ (unsigned char) (TEXT_LINE0 + 0x09 +
+ pte->device->size_phone_number));
+ } else {
+ send_text(TEXT_LINE2, TEXT_NORMAL, pte, tmp);
+ send_blink_cursor(pte);
+ send_cursor_pos(pte,
(unsigned char) (TEXT_LINE2 + 0x09 +
pte->device->size_phone_number));
+ }
+
send_led_update(pte, 0);
return;
}
@@ -2295,13 +2307,23 @@
else
send_select_output(pte, pte->device->output, pte->device->volume, MUTE_OFF);
SendDialTone(pte);
- send_text(TEXT_LINE0, TEXT_NORMAL, pte, "Enter the number to dial");
- send_text(TEXT_LINE1, TEXT_NORMAL, pte, "and press Call");
+
+ if (pte->device->height > 1) {
+ send_text(TEXT_LINE0, TEXT_NORMAL, pte, "Enter the number to dial");
+ send_text(TEXT_LINE1, TEXT_NORMAL, pte, "and press Call");
+ }
send_text_status(pte, "Call Redial BackSpcErase");
}
- send_text(TEXT_LINE2, TEXT_NORMAL, pte, "Number : ...............");
- send_blink_cursor(pte);
- send_cursor_pos(pte, TEXT_LINE2 + 0x09);
+
+ if (pte->device->height == 1) {
+ send_text(TEXT_LINE0, TEXT_NORMAL, pte, "Number : ...............");
+ send_blink_cursor(pte);
+ send_cursor_pos(pte, TEXT_LINE0 + 0x09);
+ } else {
+ send_text(TEXT_LINE2, TEXT_NORMAL, pte, "Number : ...............");
+ send_blink_cursor(pte);
+ send_cursor_pos(pte, TEXT_LINE2 + 0x09);
+ }
pte->device->size_phone_number = 0;
pte->device->phone_number[0] = 0;
change_favorite_icon(pte, FAV_ICON_PHONE_BLACK);
@@ -2376,10 +2398,16 @@
if (!sub->rtp)
start_rtp(sub);
send_select_output(s, s->device->output, s->device->volume, MUTE_OFF);
- send_text(TEXT_LINE0, TEXT_NORMAL, s, "Calling :");
- send_text(TEXT_LINE1, TEXT_NORMAL, s, s->device->phone_number);
- send_text(TEXT_LINE2, TEXT_NORMAL, s, "Dialing...");
+
+ if (s->device->height == 1) {
+ send_text(TEXT_LINE0, TEXT_NORMAL, s, s->device->phone_number);
+ } else {
+ send_text(TEXT_LINE0, TEXT_NORMAL, s, "Calling :");
+ send_text(TEXT_LINE1, TEXT_NORMAL, s, s->device->phone_number);
+ send_text(TEXT_LINE2, TEXT_NORMAL, s, "Dialing...");
+ }
send_text_status(s, "Hangup");
+
/* start switch */
if (ast_pthread_create(&t, NULL, unistim_ss, c)) {
display_last_error("Unable to create switch thread");
@@ -2426,9 +2454,14 @@
/* Swap things around between the three-way and real call */
swap_subs(p, SUB_THREEWAY, SUB_REAL);
send_select_output(s, s->device->output, s->device->volume, MUTE_OFF);
- send_text(TEXT_LINE0, TEXT_NORMAL, s, "Calling (pre-transfer)");
- send_text(TEXT_LINE1, TEXT_NORMAL, s, s->device->phone_number);
- send_text(TEXT_LINE2, TEXT_NORMAL, s, "Dialing...");
+
+ if (s->device->height == 1) {
+ send_text(TEXT_LINE0, TEXT_NORMAL, s, s->device->phone_number);
+ } else {
+ send_text(TEXT_LINE0, TEXT_NORMAL, s, "Calling (pre-transfer)");
+ send_text(TEXT_LINE1, TEXT_NORMAL, s, s->device->phone_number);
+ send_text(TEXT_LINE2, TEXT_NORMAL, s, "Dialing...");
+ }
send_text_status(s, "TransfrCancel");
if (ast_pthread_create(&t, NULL, unistim_ss, p->subs[SUB_THREEWAY]->owner)) {
@@ -2691,7 +2724,11 @@
pte->device->phone_number[i] = keycode;
pte->device->size_phone_number++;
pte->device->phone_number[i + 1] = 0;
- send_text(TEXT_LINE2, TEXT_NORMAL, pte, tmpbuf);
+ if (pte->device->height == 1) {
+ send_text(TEXT_LINE0, TEXT_NORMAL, pte, tmpbuf);
+ } else {
+ send_text(TEXT_LINE2, TEXT_NORMAL, pte, tmpbuf);
+ }
send_blink_cursor(pte);
send_cursor_pos(pte, (unsigned char) (TEXT_LINE2 + 0x0a + i));
return;
@@ -2699,9 +2736,15 @@
if (keycode == KEY_FUNC4) {
pte->device->size_phone_number = 0;
- send_text(TEXT_LINE2, TEXT_NORMAL, pte, "Number : ...............");
- send_blink_cursor(pte);
- send_cursor_pos(pte, TEXT_LINE2 + 0x09);
+ if (pte->device->height == 1) {
+ send_text(TEXT_LINE0, TEXT_NORMAL, pte, "Number : ...............");
+ send_blink_cursor(pte);
+ send_cursor_pos(pte, TEXT_LINE0 + 0x09);
+ } else {
+ send_text(TEXT_LINE2, TEXT_NORMAL, pte, "Number : ...............");
+ send_blink_cursor(pte);
+ send_cursor_pos(pte, TEXT_LINE2 + 0x09);
+ }
return;
}
@@ -2739,9 +2782,14 @@
ast_moh_stop(ast_bridged_channel(pte->device->lines->subs[SUB_REAL]->owner));
pte->device->moh = 0;
pte->state = STATE_CALL;
- send_text(TEXT_LINE0, TEXT_NORMAL, pte, "Dialing canceled,");
- send_text(TEXT_LINE1, TEXT_NORMAL, pte, "switching back to");
- send_text(TEXT_LINE2, TEXT_NORMAL, pte, "previous call.");
+
+ if (pte->device->height == 1) {
+ send_text(TEXT_LINE0, TEXT_NORMAL, pte, "Dial Cancel,back to priv. call.");
+ } else {
+ send_text(TEXT_LINE0, TEXT_NORMAL, pte, "Dialing canceled,");
+ send_text(TEXT_LINE1, TEXT_NORMAL, pte, "switching back to");
+ send_text(TEXT_LINE2, TEXT_NORMAL, pte, "previous call.");
+ }
send_text_status(pte, "Hangup Transf");
} else
show_main_page(pte);
@@ -3099,8 +3147,12 @@
send_favorite(pte->device->softkeylinepos, FAV_ICON_ONHOOK_BLACK, pte,
pte->device->softkeylabel[pte->device->softkeylinepos]);
if (!ast_strlen_zero(pte->device->call_forward)) {
- send_text(TEXT_LINE0, TEXT_NORMAL, pte, "Call forwarded to :");
- send_text(TEXT_LINE1, TEXT_NORMAL, pte, pte->device->call_forward);
+ if (pte->device->height == 1) {
+ send_text(TEXT_LINE0, TEXT_NORMAL, pte, "Forwarding ON");
+ } else {
+ send_text(TEXT_LINE0, TEXT_NORMAL, pte, "Call forwarded to :");
+ send_text(TEXT_LINE1, TEXT_NORMAL, pte, pte->device->call_forward);
+ }
Sendicon(TEXT_LINE0, FAV_ICON_REFLECT + FAV_BLINK_SLOW, pte);
send_text_status(pte, "Dial Redial NoForwd");
} else {
@@ -3684,10 +3736,18 @@
if (sub->owner) {
if (sub->owner->connected.id.XXX_number.valid
&& sub->owner->connected.id.XXX_number.str) {
- send_text(TEXT_LINE1, TEXT_NORMAL, session, sub->owner->connected.id.XXX_number.str);
+ if (session->device->height == 1) {
+ send_text(TEXT_LINE0, TEXT_NORMAL, session, sub->owner->connected.id.XXX_number.str);
+ } else {
+ send_text(TEXT_LINE1, TEXT_NORMAL, session, sub->owner->connected.id.XXX_number.str);
+ }
change_callerid(session, 0, sub->owner->connected.id.XXX_number.str);
} else {
- send_text(TEXT_LINE1, TEXT_NORMAL, session, DEFAULTCALLERID);
+ if (session->device->height == 1) {
+ send_text(TEXT_LINE0, TEXT_NORMAL, session, DEFAULTCALLERID);
+ } else {
+ send_text(TEXT_LINE1, TEXT_NORMAL, session, DEFAULTCALLERID);
+ }
change_callerid(session, 0, DEFAULTCALLERID);
}
if (sub->owner->connected.id.XXX_name.valid
@@ -3700,7 +3760,7 @@
}
}
send_text(TEXT_LINE2, TEXT_NORMAL, session, "is calling you.");
- send_text_status(session, "Accept Ignore");
+ send_text_status(session, "Accept Ignore");
if (sub->ringstyle == -1)
send_ring(session, session->device->ringvolume, session->device->ringstyle);
@@ -4366,8 +4426,12 @@
}
if (size <= TEXT_LENGTH_MAX * 2) {
- send_text(TEXT_LINE0, TEXT_NORMAL, pte, "Message :");
- send_text(TEXT_LINE1, TEXT_NORMAL, pte, text);
+ if (pte->device->height == 1) {
+ send_text(TEXT_LINE0, TEXT_NORMAL, pte, text);
+ } else {
+ send_text(TEXT_LINE0, TEXT_NORMAL, pte, "Message :");
+ send_text(TEXT_LINE1, TEXT_NORMAL, pte, text);
+ }
if (size <= TEXT_LENGTH_MAX) {
send_text(TEXT_LINE2, TEXT_NORMAL, pte, "");
return 0;
@@ -5063,6 +5127,7 @@
d->previous_output = OUTPUT_HANDSET;
d->volume = VOLUME_LOW;
d->mute = MUTE_OFF;
+ d->height = DEFAULTHEIGHT;
linelabel[0] = '\0';
dateformat = 1;
timeformat = 1;
@@ -5225,6 +5290,10 @@
l->next = d->lines;
d->lines = l;
}
+ } else if (!strcasecmp(v->name, "height")) {
+ /* Allow the user to lower the expected display lines on the phone
+ * For example the Nortal I2001 and I2002 only have one ! */
+ d->height = atoi(v->value);
} else
ast_log(LOG_WARNING, "Don't know keyword '%s' at line %d\n", v->name,
v->lineno);
Modified: team/rmudgett/ani/configs/osp.conf.sample
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/ani/configs/osp.conf.sample?view=diff&rev=275666&r1=275665&r2=275666
==============================================================================
--- team/rmudgett/ani/configs/osp.conf.sample (original)
+++ team/rmudgett/ani/configs/osp.conf.sample Mon Jul 12 11:58:58 2010
@@ -102,6 +102,13 @@
;
;defaultprotocol=SIP
;
+; Set the work mode.
+; 0 - Direct
+; 1 - Indirect
+; Default is 0,
+;
+;workmode=0
+;
; Set the service type.
; 0 - Normal voice service
; 1 - Ported number query service
Modified: team/rmudgett/ani/configs/unistim.conf.sample
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/ani/configs/unistim.conf.sample?view=diff&rev=275666&r1=275665&r2=275666
==============================================================================
--- team/rmudgett/ani/configs/unistim.conf.sample (original)
+++ team/rmudgett/ani/configs/unistim.conf.sample Mon Jul 12 11:58:58 2010
@@ -48,6 +48,8 @@
;rtp_method=0 ; If you don't have sound, you can try 1, 2 or 3, default = 0
;status_method=0 ; If you don't see status text, try 1, default = 0
;titledefault=Asterisk ; default = "TimeZone (your time zone)". 12 characters max
+;height=3 ; default = 3, the number of display lines the device can show
+ ; For example on a Nortel I2001 or I2002, set this to 1
;maintext0="you can insert" ; default = "Welcome", 24 characters max
;maintext1="a custom text" ; default = the name of the device, 24 characters max
;maintext2="(main page)" ; default = the public IP of the phone, 24 characters max
Modified: team/rmudgett/ani/main/netsock2.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/ani/main/netsock2.c?view=diff&rev=275666&r1=275665&r2=275666
==============================================================================
--- team/rmudgett/ani/main/netsock2.c (original)
+++ team/rmudgett/ani/main/netsock2.c Mon Jul 12 11:58:58 2010
@@ -195,7 +195,11 @@
/* Hint to get only one entry from getaddrinfo */
hints.ai_socktype = SOCK_DGRAM;
+#ifdef AI_NUMERICSERV
hints.ai_flags = AI_NUMERICHOST | AI_NUMERICSERV;
+#else
+ hints.ai_flags = AI_NUMERICHOST;
+#endif
if ((e = getaddrinfo(host, port, &hints, &res))) {
ast_log(LOG_ERROR, "getaddrinfo(\"%s\", \"%s\", ...): %s\n",
host, S_OR(port, "(null)"), gai_strerror(e));
More information about the asterisk-commits
mailing list