update to asterisk 1.8.5.0, chan_unistim parts from & ok ian@

This commit is contained in:
sthen 2011-07-12 19:54:39 +00:00
parent 75910e6a76
commit 64aa216876
8 changed files with 169 additions and 182 deletions

View File

@ -1,16 +1,14 @@
# $OpenBSD: Makefile,v 1.120 2011/07/07 01:19:02 ajacoutot Exp $ # $OpenBSD: Makefile,v 1.121 2011/07/12 19:54:39 sthen Exp $
SHARED_ONLY= Yes SHARED_ONLY= Yes
COMMENT-main= open source multi-protocol PBX and telephony toolkit COMMENT-main= open source multi-protocol PBX and telephony toolkit
VER= 1.8.4.4 VER= 1.8.5.0
DISTNAME= asterisk-${VER:S/beta/-beta/:S/rc/-rc/} DISTNAME= asterisk-${VER:S/beta/-beta/:S/rc/-rc/}
PKGNAME-main= asterisk-${VER} PKGNAME-main= asterisk-${VER}
REVISION-main= 0
SOUNDS= CORE MOH EXTRA SOUNDS= CORE MOH EXTRA
SOUNDS_CORE= asterisk-core-sounds-en-gsm-1.4.20 SOUNDS_CORE= asterisk-core-sounds-en-gsm-1.4.21
SOUNDS_MOH= asterisk-moh-opsound-wav-2.03 SOUNDS_MOH= asterisk-moh-opsound-wav-2.03
SOUNDS_EXTRA= asterisk-extra-sounds-en-gsm-1.4.11 SOUNDS_EXTRA= asterisk-extra-sounds-en-gsm-1.4.11

View File

@ -1,34 +1,34 @@
MD5 (asterisk-1.8.4.4.tar.gz) = vCoRaGA4FcI/IEkn0ecyOQ== MD5 (asterisk-1.8.5.0.tar.gz) = vxPYATb7RfP7NYaGBBMiRQ==
MD5 (asterisk-core-sounds-en-gsm-1.4.20.tar.gz) = XyGAxhZleNMCJj628d77lg== MD5 (asterisk-core-sounds-en-gsm-1.4.21.tar.gz) = 8yNq9tzkl4q71yG8SlIpxQ==
MD5 (asterisk-core-sounds-en-gsm-1.4.20.tar.gz.sha1) = 4aZTAcb0h9zeG2sOVvVzDA== MD5 (asterisk-core-sounds-en-gsm-1.4.21.tar.gz.sha1) = wE7SspXGAexuGqGgygoqUg==
MD5 (asterisk-extra-sounds-en-gsm-1.4.11.tar.gz) = VHnLTLgdZ4ME2W815JM6EQ== MD5 (asterisk-extra-sounds-en-gsm-1.4.11.tar.gz) = VHnLTLgdZ4ME2W815JM6EQ==
MD5 (asterisk-extra-sounds-en-gsm-1.4.11.tar.gz.sha1) = euKCSaScLc2s72YD1p39Zg== MD5 (asterisk-extra-sounds-en-gsm-1.4.11.tar.gz.sha1) = euKCSaScLc2s72YD1p39Zg==
MD5 (asterisk-moh-opsound-wav-2.03.tar.gz) = gnfixpP9BWdzscFeTVIHfQ== MD5 (asterisk-moh-opsound-wav-2.03.tar.gz) = gnfixpP9BWdzscFeTVIHfQ==
MD5 (asterisk-moh-opsound-wav-2.03.tar.gz.sha1) = AR+k3J/jXcPTTtVXuwQmPw== MD5 (asterisk-moh-opsound-wav-2.03.tar.gz.sha1) = AR+k3J/jXcPTTtVXuwQmPw==
RMD160 (asterisk-1.8.4.4.tar.gz) = yVyrGyRUfxq9Ip3PMjzH7QsLNqA= RMD160 (asterisk-1.8.5.0.tar.gz) = yEGZP5FL0VBpa5FjocwdGCj0Xko=
RMD160 (asterisk-core-sounds-en-gsm-1.4.20.tar.gz) = QrmFXULU6TKurS7Ori+xyp/tsIs= RMD160 (asterisk-core-sounds-en-gsm-1.4.21.tar.gz) = O0Gq6dHpWqYiuJHDZlF/d63wf8c=
RMD160 (asterisk-core-sounds-en-gsm-1.4.20.tar.gz.sha1) = 9jjgmgvJGKJh4cM4vEIVdnKlNAQ= RMD160 (asterisk-core-sounds-en-gsm-1.4.21.tar.gz.sha1) = 8gJwVqUSMqzqNgDg31MxXGMdi8Q=
RMD160 (asterisk-extra-sounds-en-gsm-1.4.11.tar.gz) = aBcMdp1znWtbNbAPmZrWu/h2+fY= RMD160 (asterisk-extra-sounds-en-gsm-1.4.11.tar.gz) = aBcMdp1znWtbNbAPmZrWu/h2+fY=
RMD160 (asterisk-extra-sounds-en-gsm-1.4.11.tar.gz.sha1) = r2FBQo0Mel1qCQPV61rbSFUnkNY= RMD160 (asterisk-extra-sounds-en-gsm-1.4.11.tar.gz.sha1) = r2FBQo0Mel1qCQPV61rbSFUnkNY=
RMD160 (asterisk-moh-opsound-wav-2.03.tar.gz) = lWaXSoNgUeCPUUEt5QjZK/O+fgI= RMD160 (asterisk-moh-opsound-wav-2.03.tar.gz) = lWaXSoNgUeCPUUEt5QjZK/O+fgI=
RMD160 (asterisk-moh-opsound-wav-2.03.tar.gz.sha1) = D+hFjrIugSleLHkzLWEgvA7kjfM= RMD160 (asterisk-moh-opsound-wav-2.03.tar.gz.sha1) = D+hFjrIugSleLHkzLWEgvA7kjfM=
SHA1 (asterisk-1.8.4.4.tar.gz) = B9OuV0Ti3RDF2VZLUDaQ8/C4TZY= SHA1 (asterisk-1.8.5.0.tar.gz) = nilYHe6nc8JTf1wBpDgjIRaIQSo=
SHA1 (asterisk-core-sounds-en-gsm-1.4.20.tar.gz) = /1nj3UcJr0j69nws7CiWi9zWLk0= SHA1 (asterisk-core-sounds-en-gsm-1.4.21.tar.gz) = 3iQ4A9xTdlkkQOzPRWB1a/MpjIA=
SHA1 (asterisk-core-sounds-en-gsm-1.4.20.tar.gz.sha1) = 1DqTOIM1s1tS30CW8clyDq+R9Os= SHA1 (asterisk-core-sounds-en-gsm-1.4.21.tar.gz.sha1) = /UQAQgYDfApyMoJrmMgXsSUOCX0=
SHA1 (asterisk-extra-sounds-en-gsm-1.4.11.tar.gz) = hpL6YUI7R2nci/p4+vntXveiWbk= SHA1 (asterisk-extra-sounds-en-gsm-1.4.11.tar.gz) = hpL6YUI7R2nci/p4+vntXveiWbk=
SHA1 (asterisk-extra-sounds-en-gsm-1.4.11.tar.gz.sha1) = 7mrmsEnCtwUNV0J+RJd/3sI3wYE= SHA1 (asterisk-extra-sounds-en-gsm-1.4.11.tar.gz.sha1) = 7mrmsEnCtwUNV0J+RJd/3sI3wYE=
SHA1 (asterisk-moh-opsound-wav-2.03.tar.gz) = 9A/W6gPf6Ncq2iVAsiiL/cAGOB0= SHA1 (asterisk-moh-opsound-wav-2.03.tar.gz) = 9A/W6gPf6Ncq2iVAsiiL/cAGOB0=
SHA1 (asterisk-moh-opsound-wav-2.03.tar.gz.sha1) = y7b1cl1V/jLKmqKzM+N9YSXQ9Ec= SHA1 (asterisk-moh-opsound-wav-2.03.tar.gz.sha1) = y7b1cl1V/jLKmqKzM+N9YSXQ9Ec=
SHA256 (asterisk-1.8.4.4.tar.gz) = CNROfP1cMG2UTNSOuKSXo0Xru054HXpsyRc3Z4R4nB8= SHA256 (asterisk-1.8.5.0.tar.gz) = XEYBwNqyyUo9w3yrXVWvjqtndlox64rtcyHdmOfGKkY=
SHA256 (asterisk-core-sounds-en-gsm-1.4.20.tar.gz) = 6HhpuMXN1zILHPTeUgh58lz4tcLaNwen7v4z4IlbsBc= SHA256 (asterisk-core-sounds-en-gsm-1.4.21.tar.gz) = ineRiqNKmogFZoOQjX7s5i/T7Y9Xflb2m7poYNUoAxQ=
SHA256 (asterisk-core-sounds-en-gsm-1.4.20.tar.gz.sha1) = CkpTcoPBJgMHmqgMDqUPfnmfDMz7fQGGuA/DwV+BR3c= SHA256 (asterisk-core-sounds-en-gsm-1.4.21.tar.gz.sha1) = hrrLLZKR7wmY1b3MkHsqYlG2ByHCzvhlWViXAr4tcYM=
SHA256 (asterisk-extra-sounds-en-gsm-1.4.11.tar.gz) = 1fAxzDHr6+yZzj/PRP+Ue9eye16VZaezphhcLRvaCUw= SHA256 (asterisk-extra-sounds-en-gsm-1.4.11.tar.gz) = 1fAxzDHr6+yZzj/PRP+Ue9eye16VZaezphhcLRvaCUw=
SHA256 (asterisk-extra-sounds-en-gsm-1.4.11.tar.gz.sha1) = a0BErk9wQ3/hT5gPUVL6uk6iqitdhAKMAhOrL2XHSR8= SHA256 (asterisk-extra-sounds-en-gsm-1.4.11.tar.gz.sha1) = a0BErk9wQ3/hT5gPUVL6uk6iqitdhAKMAhOrL2XHSR8=
SHA256 (asterisk-moh-opsound-wav-2.03.tar.gz) = RJ+4ENFlAsMFL+3wL353s2IGrFoUXz2s9Bd4Q6L8tTg= SHA256 (asterisk-moh-opsound-wav-2.03.tar.gz) = RJ+4ENFlAsMFL+3wL353s2IGrFoUXz2s9Bd4Q6L8tTg=
SHA256 (asterisk-moh-opsound-wav-2.03.tar.gz.sha1) = Y8VUFsoRQmGrGvT9EVIyLy7GnZGrw0vEzufTKByuDZc= SHA256 (asterisk-moh-opsound-wav-2.03.tar.gz.sha1) = Y8VUFsoRQmGrGvT9EVIyLy7GnZGrw0vEzufTKByuDZc=
SIZE (asterisk-1.8.4.4.tar.gz) = 27326189 SIZE (asterisk-1.8.5.0.tar.gz) = 27417584
SIZE (asterisk-core-sounds-en-gsm-1.4.20.tar.gz) = 1784804 SIZE (asterisk-core-sounds-en-gsm-1.4.21.tar.gz) = 1785758
SIZE (asterisk-core-sounds-en-gsm-1.4.20.tar.gz.sha1) = 84 SIZE (asterisk-core-sounds-en-gsm-1.4.21.tar.gz.sha1) = 84
SIZE (asterisk-extra-sounds-en-gsm-1.4.11.tar.gz) = 3349898 SIZE (asterisk-extra-sounds-en-gsm-1.4.11.tar.gz) = 3349898
SIZE (asterisk-extra-sounds-en-gsm-1.4.11.tar.gz.sha1) = 85 SIZE (asterisk-extra-sounds-en-gsm-1.4.11.tar.gz.sha1) = 85
SIZE (asterisk-moh-opsound-wav-2.03.tar.gz) = 15359473 SIZE (asterisk-moh-opsound-wav-2.03.tar.gz) = 15359473

View File

@ -1,7 +1,8 @@
$OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $ $OpenBSD: patch-channels_chan_unistim_c,v 1.3 2011/07/12 19:54:39 sthen Exp $
# Patch is from https://bugs.digium.com/view.php?id=18229, in particular, chan_unistim.c.r299906-6.diff # Patch is from https://bugs.digium.com/view.php?id=18229, in particular, chan_unistim.c.r299906-6.diff
--- channels/chan_unistim.c.orig Wed Jul 14 16:48:36 2010 --- channels/chan_unistim.c.orig Thu May 5 18:53:45 2011
+++ channels/chan_unistim.c Fri Jun 24 14:21:26 2011 +++ channels/chan_unistim.c Tue Jul 12 12:28:03 2011
@@ -32,6 +32,15 @@ @@ -32,6 +32,15 @@
* \ingroup channel_drivers * \ingroup channel_drivers
*/ */
@ -17,8 +18,8 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
+ +
#include "asterisk.h" #include "asterisk.h"
ASTERISK_FILE_VERSION(__FILE__, "$Revision: 1.2 $") ASTERISK_FILE_VERSION(__FILE__, "$Revision: 1.3 $")
@@ -69,6 +78,8 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision: 1.2 $") @@ -69,6 +78,8 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision: 1.3 $")
#include "asterisk/musiconhold.h" #include "asterisk/musiconhold.h"
#include "asterisk/causes.h" #include "asterisk/causes.h"
#include "asterisk/indications.h" #include "asterisk/indications.h"
@ -27,7 +28,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
/*! Beware, G729 and G723 are not supported by asterisk, except with the proper licence */ /*! Beware, G729 and G723 are not supported by asterisk, except with the proper licence */
#define CAPABILITY AST_FORMAT_ALAW | AST_FORMAT_ULAW /* | AST_FORMAT_G729A | AST_FORMAT_G723_1 */ #define CAPABILITY AST_FORMAT_ALAW | AST_FORMAT_ULAW /* | AST_FORMAT_G729A | AST_FORMAT_G723_1 */
@@ -78,11 +89,14 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision: 1.2 $") @@ -78,11 +89,14 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision: 1.3 $")
#define DEFAULTCALLERNAME " " #define DEFAULTCALLERNAME " "
#define DEFAULTHEIGHT 3 #define DEFAULTHEIGHT 3
#define USTM_LOG_DIR "unistimHistory" #define USTM_LOG_DIR "unistimHistory"
@ -42,7 +43,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
/*! Try x times before removing the phone */ /*! Try x times before removing the phone */
#define NB_MAX_RETRANSMIT 8 #define NB_MAX_RETRANSMIT 8
/*! Nb of milliseconds waited when no events are scheduled */ /*! Nb of milliseconds waited when no events are scheduled */
@@ -99,8 +113,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision: 1.2 $") @@ -99,8 +113,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision: 1.3 $")
#define MAX_ENTRY_LOG 30 #define MAX_ENTRY_LOG 30
#define SUB_REAL 0 #define SUB_REAL 0
@ -69,7 +70,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
static void dummy(char *unused, ...) static void dummy(char *unused, ...)
{ {
return; return;
@@ -251,7 +274,10 @@ enum phone_state { @@ -252,7 +275,10 @@ enum phone_state {
STATE_DIALPAGE, STATE_DIALPAGE,
STATE_RINGING, STATE_RINGING,
STATE_CALL, STATE_CALL,
@ -80,7 +81,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
STATE_CLEANING, STATE_CLEANING,
STATE_HISTORY STATE_HISTORY
}; };
@@ -302,45 +328,17 @@ enum phone_key { @@ -303,45 +329,17 @@ enum phone_key {
KEY_INDEX = 0x7f KEY_INDEX = 0x7f
}; };
@ -135,7 +136,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
struct wsabuf { struct wsabuf {
u_long len; u_long len;
@@ -360,7 +358,7 @@ struct systemtime { @@ -361,7 +359,7 @@ struct systemtime {
struct unistim_subchannel { struct unistim_subchannel {
ast_mutex_t lock; ast_mutex_t lock;
@ -144,7 +145,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
unsigned int subtype; unsigned int subtype;
/*! Asterisk channel used by the subchannel */ /*! Asterisk channel used by the subchannel */
struct ast_channel *owner; struct ast_channel *owner;
@@ -368,9 +366,14 @@ struct unistim_subchannel { @@ -369,9 +367,14 @@ struct unistim_subchannel {
struct unistim_line *parent; struct unistim_line *parent;
/*! RTP handle */ /*! RTP handle */
struct ast_rtp_instance *rtp; struct ast_rtp_instance *rtp;
@ -159,7 +160,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
}; };
/*! /*!
@@ -382,14 +385,10 @@ struct unistim_line { @@ -383,14 +386,10 @@ struct unistim_line {
char name[80]; char name[80];
/*! Like USTM/200\@black */ /*! Like USTM/200\@black */
char fullname[80]; char fullname[80];
@ -174,7 +175,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
/*! CallerID Number */ /*! CallerID Number */
char cid_num[AST_MAX_EXTENSION]; char cid_num[AST_MAX_EXTENSION];
/*! Mailbox for MWI */ /*! Mailbox for MWI */
@@ -414,6 +413,7 @@ struct unistim_line { @@ -415,6 +414,7 @@ struct unistim_line {
char parkinglot[AST_MAX_CONTEXT]; char parkinglot[AST_MAX_CONTEXT];
struct unistim_line *next; struct unistim_line *next;
struct unistim_device *parent; struct unistim_device *parent;
@ -182,7 +183,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
}; };
/*! /*!
@@ -422,19 +422,21 @@ struct unistim_line { @@ -423,19 +423,21 @@ struct unistim_line {
static struct unistim_device { static struct unistim_device {
int receiver_state; /*!< state of the receiver (see ReceiverState) */ int receiver_state; /*!< state of the receiver (see ReceiverState) */
int size_phone_number; /*!< size of the phone number */ int size_phone_number; /*!< size of the phone number */
@ -213,7 +214,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
char maintext0[25]; /*!< when the phone is idle, display this string on line 0 */ 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 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 */ char maintext2[25]; /*!< when the phone is idle, display this string on line 2 */
@@ -445,12 +447,16 @@ static struct unistim_device { @@ -446,12 +448,16 @@ static struct unistim_device {
struct ast_tone_zone *tz; /*!< Tone zone for res_indications (ring, busy, congestion) */ struct ast_tone_zone *tz; /*!< Tone zone for res_indications (ring, busy, congestion) */
char ringvolume; /*!< Ring volume */ char ringvolume; /*!< Ring volume */
char ringstyle; /*!< Ring melody */ char ringstyle; /*!< Ring melody */
@ -231,7 +232,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
char lst_cid[TEXT_LENGTH_MAX]; /*!< Last callerID received */ char lst_cid[TEXT_LENGTH_MAX]; /*!< Last callerID received */
char lst_cnm[TEXT_LENGTH_MAX]; /*!< Last callername recevied */ char lst_cnm[TEXT_LENGTH_MAX]; /*!< Last callername recevied */
char call_forward[AST_MAX_EXTENSION]; /*!< Forward number */ char call_forward[AST_MAX_EXTENSION]; /*!< Forward number */
@@ -458,15 +464,14 @@ static struct unistim_device { @@ -459,15 +465,14 @@ static struct unistim_device {
int previous_output; /*!< Previous output */ int previous_output; /*!< Previous output */
int volume; /*!< Default volume */ int volume; /*!< Default volume */
int mute; /*!< Mute mode */ int mute; /*!< Mute mode */
@ -250,7 +251,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
struct unistimsession *session; struct unistimsession *session;
struct unistim_device *next; struct unistim_device *next;
} *devices = NULL; } *devices = NULL;
@@ -489,9 +494,23 @@ static struct unistimsession { @@ -490,9 +495,23 @@ static struct unistimsession {
struct wsabuf wsabufsend[MAX_BUF_NUMBER]; /*!< Size of each paquet stored in the buffer array & pointer to this buffer */ struct wsabuf wsabufsend[MAX_BUF_NUMBER]; /*!< Size of each paquet stored in the buffer array & pointer to this buffer */
unsigned char buf[MAX_BUF_NUMBER][MAX_BUF_SIZE]; /*!< Buffer array used to keep the lastest non-acked paquets */ unsigned char buf[MAX_BUF_NUMBER][MAX_BUF_SIZE]; /*!< Buffer array used to keep the lastest non-acked paquets */
struct unistim_device *device; struct unistim_device *device;
@ -275,7 +276,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
/*! /*!
* \page Unistim datagram formats * \page Unistim datagram formats
* *
@@ -623,10 +642,14 @@ static const unsigned char packet_send_date_time2[] = @@ -624,10 +643,14 @@ static const unsigned char packet_send_date_time2[] =
}; };
static const unsigned char packet_send_Contrast[] = static const unsigned char packet_send_Contrast[] =
{ 0x17, 0x04, 0x24, /*Contrast */ 0x08 }; { 0x17, 0x04, 0x24, /*Contrast */ 0x08 };
@ -294,7 +295,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
static const unsigned char packet_send_icon[] = { 0x17, 0x05, 0x14, /*pos */ 0x00, /*icon */ 0x25 }; /* display an icon in front of the text zone */ static const unsigned char packet_send_icon[] = { 0x17, 0x05, 0x14, /*pos */ 0x00, /*icon */ 0x25 }; /* display an icon in front of the text zone */
static const unsigned char packet_send_S7[] = { 0x17, 0x06, 0x0f, 0x30, 0x07, 0x07 }; static const unsigned char packet_send_S7[] = { 0x17, 0x06, 0x0f, 0x30, 0x07, 0x07 };
static const unsigned char packet_send_set_pos_cursor[] = static const unsigned char packet_send_set_pos_cursor[] =
@@ -657,6 +680,23 @@ static const unsigned char packet_send_status2[] = @@ -658,6 +681,23 @@ static const unsigned char packet_send_status2[] =
{ 0x17, 0x0b, 0x19, /* pos [08|28|48|68] */ 0x00, /* text */ 0x20, 0x20, 0x20, 0x20, { 0x17, 0x0b, 0x19, /* pos [08|28|48|68] */ 0x00, /* text */ 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20 /* end_text */ }; 0x20, 0x20, 0x20 /* end_text */ };
@ -318,7 +319,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
static const unsigned char packet_send_led_update[] = { 0x19, 0x04, 0x00, 0x00 }; static const unsigned char packet_send_led_update[] = { 0x19, 0x04, 0x00, 0x00 };
static const unsigned char packet_send_query_basic_manager_04[] = { 0x1a, 0x04, 0x01, 0x04 }; static const unsigned char packet_send_query_basic_manager_04[] = { 0x1a, 0x04, 0x01, 0x04 };
@@ -717,14 +757,129 @@ static const struct ast_channel_tech unistim_tech = { @@ -718,14 +758,129 @@ static const struct ast_channel_tech unistim_tech = {
.bridge = ast_rtp_instance_bridge, .bridge = ast_rtp_instance_bridge,
}; };
@ -451,7 +452,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
strerror(errno)); strerror(errno));
} }
@@ -950,10 +1105,44 @@ static void send_start_timer(struct unistimsession *pt @@ -951,10 +1106,44 @@ static void send_start_timer(struct unistimsession *pt
BUFFSEND; BUFFSEND;
if (unistimdebug) if (unistimdebug)
ast_verb(0, "Sending start timer\n"); ast_verb(0, "Sending start timer\n");
@ -498,7 +499,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
static void send_stop_timer(struct unistimsession *pte) static void send_stop_timer(struct unistimsession *pte)
{ {
BUFFSEND; BUFFSEND;
@@ -963,7 +1152,7 @@ static void send_stop_timer(struct unistimsession *pte @@ -964,7 +1153,7 @@ static void send_stop_timer(struct unistimsession *pte
send_client(SIZE_HEADER + sizeof(packet_send_stop_timer), buffsend, pte); send_client(SIZE_HEADER + sizeof(packet_send_stop_timer), buffsend, pte);
} }
@ -507,7 +508,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
{ {
BUFFSEND; BUFFSEND;
if (unistimdebug) if (unistimdebug)
@@ -1021,9 +1210,9 @@ static void send_tone(struct unistimsession *pte, uint @@ -1022,9 +1211,9 @@ static void send_tone(struct unistimsession *pte, uint
/* Positions for favorites /* Positions for favorites
|--------------------| |--------------------|
@ -520,7 +521,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
*/ */
/* status (icons) : 00 = nothing, 2x/3x = see parser.h, 4x/5x = blink fast, 6x/7x = blink slow */ /* status (icons) : 00 = nothing, 2x/3x = see parser.h, 4x/5x = blink fast, 6x/7x = blink slow */
@@ -1040,44 +1229,122 @@ send_favorite(unsigned char pos, unsigned char status, @@ -1041,44 +1230,122 @@ send_favorite(unsigned char pos, unsigned char status,
buffsend[10] = pos; buffsend[10] = pos;
buffsend[24] = pos; buffsend[24] = pos;
buffsend[25] = status; buffsend[25] = status;
@ -657,7 +658,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
if (d->sp[i] == pte->device) { /* It's us ? */ if (d->sp[i] == pte->device) { /* It's us ? */
if (d->softkeyicon[i] != status) { /* Avoid resending the same icon */ if (d->softkeyicon[i] != status) { /* Avoid resending the same icon */
d->softkeyicon[i] = status; d->softkeyicon[i] = status;
@@ -1090,30 +1357,40 @@ static void change_favorite_icon(struct unistimsession @@ -1091,30 +1358,40 @@ static void change_favorite_icon(struct unistimsession
} }
} }
@ -707,7 +708,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
struct unistimsession *cur, *prev = NULL; struct unistimsession *cur, *prev = NULL;
ast_mutex_lock(&sessionlock); ast_mutex_lock(&sessionlock);
cur = sessions; cur = sessions;
@@ -1127,12 +1404,11 @@ static void close_client(struct unistimsession *s) @@ -1128,12 +1405,11 @@ static void close_client(struct unistimsession *s)
if (cur) { /* Session found ? */ if (cur) { /* Session found ? */
if (cur->device) { /* This session was registered ? */ if (cur->device) { /* This session was registered ? */
s->state = STATE_CLEANING; s->state = STATE_CLEANING;
@ -723,7 +724,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
if (sub) { if (sub) {
if (sub->owner) { /* Call in progress ? */ if (sub->owner) { /* Call in progress ? */
if (unistimdebug) if (unistimdebug)
@@ -1142,7 +1418,7 @@ static void close_client(struct unistimsession *s) @@ -1143,7 +1419,7 @@ static void close_client(struct unistimsession *s)
} else } else
ast_log(LOG_WARNING, "Freeing a client with no subchannel !\n"); ast_log(LOG_WARNING, "Freeing a client with no subchannel !\n");
if (!ast_strlen_zero(s->device->extension_number)) if (!ast_strlen_zero(s->device->extension_number))
@ -732,7 +733,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
cur->device->session = NULL; cur->device->session = NULL;
} else { } else {
if (unistimdebug) if (unistimdebug)
@@ -1206,6 +1482,12 @@ send_text(unsigned char pos, unsigned char inverse, st @@ -1207,6 +1483,12 @@ send_text(unsigned char pos, unsigned char inverse, st
{ {
int i; int i;
BUFFSEND; BUFFSEND;
@ -745,7 +746,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
if (unistimdebug) if (unistimdebug)
ast_verb(0, "Sending text at pos %d, inverse flag %d\n", pos, inverse); ast_verb(0, "Sending text at pos %d, inverse flag %d\n", pos, inverse);
memcpy(buffsend + SIZE_HEADER, packet_send_text, sizeof(packet_send_text)); memcpy(buffsend + SIZE_HEADER, packet_send_text, sizeof(packet_send_text));
@@ -1365,12 +1647,21 @@ static void send_texttitle(struct unistimsession *pte, @@ -1366,12 +1648,21 @@ static void send_texttitle(struct unistimsession *pte,
} }
@ -767,7 +768,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
if (unistimdebug) if (unistimdebug)
ast_verb(0, "Sending Time & Date\n"); ast_verb(0, "Sending Time & Date\n");
memcpy(buffsend + SIZE_HEADER, packet_send_date_time, sizeof(packet_send_date_time)); memcpy(buffsend + SIZE_HEADER, packet_send_date_time, sizeof(packet_send_date_time));
@@ -1443,6 +1734,43 @@ static void send_cursor_pos(struct unistimsession *pte @@ -1444,6 +1735,43 @@ static void send_cursor_pos(struct unistimsession *pte
return; return;
} }
@ -811,7 +812,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
static void rcv_resume_connection_with_server(struct unistimsession *pte) static void rcv_resume_connection_with_server(struct unistimsession *pte)
{ {
BUFFSEND; BUFFSEND;
@@ -1483,37 +1811,91 @@ static int unistim_register(struct unistimsession *s) @@ -1484,37 +1812,91 @@ static int unistim_register(struct unistimsession *s)
return 1; return 1;
} }
@ -922,7 +923,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
static void rcv_mac_addr(struct unistimsession *pte, const unsigned char *buf) static void rcv_mac_addr(struct unistimsession *pte, const unsigned char *buf)
{ {
BUFFSEND; BUFFSEND;
@@ -1547,6 +1929,7 @@ static void rcv_mac_addr(struct unistimsession *pte, c @@ -1548,6 +1930,7 @@ static void rcv_mac_addr(struct unistimsession *pte, c
d = devices; d = devices;
while (d) { while (d) {
if (!strcasecmp(d->name, "template")) { if (!strcasecmp(d->name, "template")) {
@ -930,7 +931,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
/* Found, cloning this entry */ /* Found, cloning this entry */
if (!(newd = ast_malloc(sizeof(*newd)))) { if (!(newd = ast_malloc(sizeof(*newd)))) {
ast_mutex_unlock(&devicelock); ast_mutex_unlock(&devicelock);
@@ -1560,8 +1943,9 @@ static void rcv_mac_addr(struct unistimsession *pte, c @@ -1561,8 +1944,9 @@ static void rcv_mac_addr(struct unistimsession *pte, c
return; return;
} }
@ -942,7 +943,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
ast_free(newd); ast_free(newd);
ast_free(newl); ast_free(newl);
ast_mutex_unlock(&devicelock); ast_mutex_unlock(&devicelock);
@@ -1572,16 +1956,16 @@ static void rcv_mac_addr(struct unistimsession *pte, c @@ -1573,16 +1957,16 @@ static void rcv_mac_addr(struct unistimsession *pte, c
ast_copy_string(newd->name, addrmac, sizeof(newd->name)); ast_copy_string(newd->name, addrmac, sizeof(newd->name));
if (newd->extension == EXTENSION_NONE) if (newd->extension == EXTENSION_NONE)
newd->extension = EXTENSION_ASK; newd->extension = EXTENSION_ASK;
@ -963,7 +964,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
snprintf(newl->fullname, sizeof(newl->fullname), "USTM/%s@%s", snprintf(newl->fullname, sizeof(newl->fullname), "USTM/%s@%s",
newl->name, newd->name); newl->name, newd->name);
/* Go to the end of the linked chain */ /* Go to the end of the linked chain */
@@ -1625,16 +2009,16 @@ static void rcv_mac_addr(struct unistimsession *pte, c @@ -1626,16 +2010,16 @@ static void rcv_mac_addr(struct unistimsession *pte, c
pte->state = STATE_EXTENSION; pte->state = STATE_EXTENSION;
else { else {
/* Yes, because of a phone reboot. We don't ask again for the TN */ /* Yes, because of a phone reboot. We don't ask again for the TN */
@ -983,7 +984,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
pte->state = STATE_EXTENSION; pte->state = STATE_EXTENSION;
else else
pte->state = STATE_MAINPAGE; pte->state = STATE_MAINPAGE;
@@ -1728,11 +2112,11 @@ static int write_history(struct unistimsession *pte, c @@ -1729,11 +2113,11 @@ static int write_history(struct unistimsession *pte, c
ast_localtime(&now, &atm, NULL); ast_localtime(&now, &atm, NULL);
if (ismissed) { if (ismissed) {
if (way == 'i') if (way == 'i')
@ -998,7 +999,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
snprintf(line1, sizeof(line1), "%04d/%02d/%02d %02d:%02d:%02d %s", snprintf(line1, sizeof(line1), "%04d/%02d/%02d %02d:%02d:%02d %s",
atm.tm_year + 1900, atm.tm_mon + 1, atm.tm_mday, atm.tm_hour, atm.tm_year + 1900, atm.tm_mon + 1, atm.tm_mday, atm.tm_hour,
atm.tm_min, atm.tm_sec, tmp2); atm.tm_min, atm.tm_sec, tmp2);
@@ -1850,41 +2234,14 @@ static int write_history(struct unistimsession *pte, c @@ -1851,41 +2235,14 @@ static int write_history(struct unistimsession *pte, c
return 0; return 0;
} }
@ -1046,29 +1047,13 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
} }
static int attempt_transfer(struct unistim_subchannel *p1, struct unistim_subchannel *p2) static int attempt_transfer(struct unistim_subchannel *p1, struct unistim_subchannel *p2)
@@ -1908,33 +2265,23 @@ static int attempt_transfer(struct unistim_subchannel @@ -1919,21 +2276,11 @@ static int attempt_transfer(struct unistim_subchannel
peerb = chanb; ast_quiet_chan(peerb);
peerc = bridgea; ast_quiet_chan(peerc);
peerd = bridgeb; ast_quiet_chan(peerd); */
+ ast_log(LOG_WARNING, "1\n");
} else if (bridgeb) {
peera = chanb;
peerb = chana;
peerc = bridgeb;
peerd = bridgea;
+ ast_log(LOG_WARNING, "1\n"); /* c */
}
if (peera && peerb && peerc && (peerb != peerc)) {
- /*ast_quiet_chan(peera);
- ast_quiet_chan(peerb);
- ast_quiet_chan(peerc);
- ast_quiet_chan(peerd); */
+ unistim_quiet_chan(peera); + unistim_quiet_chan(peera);
+ unistim_quiet_chan(peerb); + unistim_quiet_chan(peerb);
+ unistim_quiet_chan(peerc); + unistim_quiet_chan(peerc);
+ if (peerd)
+ unistim_quiet_chan(peerd);
- if (peera->cdr && peerb->cdr) { - if (peera->cdr && peerb->cdr) {
- peerb->cdr = ast_cdr_append(peerb->cdr, peera->cdr); - peerb->cdr = ast_cdr_append(peerb->cdr, peera->cdr);
@ -1088,7 +1073,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
if (ast_channel_masquerade(peerb, peerc)) { if (ast_channel_masquerade(peerb, peerc)) {
ast_log(LOG_WARNING, "Failed to masquerade %s into %s\n", peerb->name, ast_log(LOG_WARNING, "Failed to masquerade %s into %s\n", peerb->name,
peerc->name); peerc->name);
@@ -1972,32 +2319,118 @@ void change_callerid(struct unistimsession *pte, int t @@ -1971,32 +2318,118 @@ void change_callerid(struct unistimsession *pte, int t
memcpy(data, callerid, size); memcpy(data, callerid, size);
} }
@ -1219,7 +1204,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
change_callerid(pte, 1, ""); change_callerid(pte, 1, "");
write_history(pte, 'o', pte->device->missed_call); write_history(pte, 'o', pte->device->missed_call);
pte->device->missed_call = 0; pte->device->missed_call = 0;
@@ -2005,9 +2438,10 @@ static void close_call(struct unistimsession *pte) @@ -2004,9 +2437,10 @@ static void close_call(struct unistimsession *pte)
return; return;
} }
@ -1231,7 +1216,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
return; return;
} }
@@ -2019,7 +2453,7 @@ static void *unistim_ss(void *data) @@ -2018,7 +2452,7 @@ static void *unistim_ss(void *data)
struct unistimsession *s = l->parent->session; struct unistimsession *s = l->parent->session;
int res; int res;
@ -1240,7 +1225,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
ast_copy_string(chan->exten, s->device->phone_number, sizeof(chan->exten)); ast_copy_string(chan->exten, s->device->phone_number, sizeof(chan->exten));
ast_copy_string(s->device->redial_number, s->device->phone_number, ast_copy_string(s->device->redial_number, s->device->phone_number,
sizeof(s->device->redial_number)); sizeof(s->device->redial_number));
@@ -2027,85 +2461,50 @@ static void *unistim_ss(void *data) @@ -2026,85 +2460,50 @@ static void *unistim_ss(void *data)
res = ast_pbx_run(chan); res = ast_pbx_run(chan);
if (res) { if (res) {
ast_log(LOG_WARNING, "PBX exited non-zero\n"); ast_log(LOG_WARNING, "PBX exited non-zero\n");
@ -1358,7 +1343,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
/* Setting up RTP of the phone */ /* Setting up RTP of the phone */
if (public_ip.sin_family == 0) /* NAT IP override ? */ if (public_ip.sin_family == 0) /* NAT IP override ? */
memcpy(&public, &us, sizeof(public)); /* No defined, using IP from recvmsg */ memcpy(&public, &us, sizeof(public)); /* No defined, using IP from recvmsg */
@@ -2118,35 +2517,35 @@ static void start_rtp(struct unistim_subchannel *sub) @@ -2117,35 +2516,35 @@ static void start_rtp(struct unistim_subchannel *sub)
ast_verb(0, "Starting phone RTP stack. Our public IP is %s\n", ast_verb(0, "Starting phone RTP stack. Our public IP is %s\n",
ast_inet_ntoa(public.sin_addr)); ast_inet_ntoa(public.sin_addr));
} }
@ -1404,7 +1389,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
memcpy(buffsend + 28, &public.sin_addr, sizeof(public.sin_addr)); memcpy(buffsend + 28, &public.sin_addr, sizeof(public.sin_addr));
buffsend[20] = (htons(sin.sin_port) & 0xff00) >> 8; buffsend[20] = (htons(sin.sin_port) & 0xff00) >> 8;
buffsend[21] = (htons(sin.sin_port) & 0x00ff); buffsend[21] = (htons(sin.sin_port) & 0x00ff);
@@ -2165,18 +2564,17 @@ static void start_rtp(struct unistim_subchannel *sub) @@ -2164,18 +2563,17 @@ static void start_rtp(struct unistim_subchannel *sub)
buffsend[11] = codec; buffsend[11] = codec;
} }
buffsend[12] = codec; buffsend[12] = codec;
@ -1426,7 +1411,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
memcpy(buffsend + 28, &public.sin_addr, sizeof(public.sin_addr)); memcpy(buffsend + 28, &public.sin_addr, sizeof(public.sin_addr));
buffsend[20] = (htons(sin.sin_port) & 0xff00) >> 8; buffsend[20] = (htons(sin.sin_port) & 0xff00) >> 8;
buffsend[21] = (htons(sin.sin_port) & 0x00ff); buffsend[21] = (htons(sin.sin_port) & 0x00ff);
@@ -2195,8 +2593,7 @@ static void start_rtp(struct unistim_subchannel *sub) @@ -2194,8 +2592,7 @@ static void start_rtp(struct unistim_subchannel *sub)
buffsend[12] = codec; buffsend[12] = codec;
} }
buffsend[11] = codec; buffsend[11] = codec;
@ -1436,7 +1421,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
} else { } else {
uint16_t rtcpsin_port = htons(us.sin_port) + 1; /* RTCP port is RTP + 1 */ uint16_t rtcpsin_port = htons(us.sin_port) + 1; /* RTCP port is RTP + 1 */
@@ -2230,73 +2627,152 @@ static void start_rtp(struct unistim_subchannel *sub) @@ -2229,73 +2626,152 @@ static void start_rtp(struct unistim_subchannel *sub)
buffsend[46] = (htons(sin.sin_port) & 0x00ff); buffsend[46] = (htons(sin.sin_port) & 0x00ff);
buffsend[47] = (rtcpsin_port & 0xff00) >> 8; buffsend[47] = (rtcpsin_port & 0xff00) >> 8;
buffsend[48] = (rtcpsin_port & 0x00ff); buffsend[48] = (rtcpsin_port & 0x00ff);
@ -1637,7 +1622,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
send_led_update(pte, 0); send_led_update(pte, 0);
return; return;
} }
@@ -2306,107 +2782,217 @@ static void handle_dial_page(struct unistimsession *pt @@ -2305,107 +2781,217 @@ static void handle_dial_page(struct unistimsession *pt
send_select_output(pte, OUTPUT_SPEAKER, pte->device->volume, MUTE_OFF); send_select_output(pte, OUTPUT_SPEAKER, pte->device->volume, MUTE_OFF);
else else
send_select_output(pte, pte->device->output, pte->device->volume, MUTE_OFF); send_select_output(pte, pte->device->output, pte->device->volume, MUTE_OFF);
@ -1907,7 +1892,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
/* start switch */ /* start switch */
if (ast_pthread_create(&t, NULL, unistim_ss, c)) { if (ast_pthread_create(&t, NULL, unistim_ss, c)) {
@@ -2416,81 +3002,51 @@ static void HandleCallOutgoing(struct unistimsession * @@ -2415,81 +3001,51 @@ static void HandleCallOutgoing(struct unistimsession *
} else } else
ast_log(LOG_WARNING, "Unable to create channel for %s@%s\n", ast_log(LOG_WARNING, "Unable to create channel for %s@%s\n",
sub->parent->name, s->device->name); sub->parent->name, s->device->name);
@ -2023,7 +2008,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
ast_verb(0, "Handle Call Incoming for %s@%s\n", sub->parent->name, ast_verb(0, "Handle Call Incoming for %s@%s\n", sub->parent->name,
s->device->name); s->device->name);
start_rtp(sub); start_rtp(sub);
@@ -2498,16 +3054,16 @@ static void HandleCallIncoming(struct unistimsession * @@ -2497,16 +3053,16 @@ static void HandleCallIncoming(struct unistimsession *
ast_log(LOG_WARNING, "Unable to create channel for %s@%s\n", sub->parent->name, ast_log(LOG_WARNING, "Unable to create channel for %s@%s\n", sub->parent->name,
s->device->name); s->device->name);
ast_queue_control(sub->owner, AST_CONTROL_ANSWER); ast_queue_control(sub->owner, AST_CONTROL_ANSWER);
@ -2044,7 +2029,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
write_history(s, 'i', 0); write_history(s, 'i', 0);
return; return;
} }
@@ -2516,8 +3072,10 @@ static int unistim_do_senddigit(struct unistimsession @@ -2515,8 +3071,10 @@ static int unistim_do_senddigit(struct unistimsession
{ {
struct ast_frame f = { .frametype = AST_FRAME_DTMF, .subclass.integer = digit, .src = "unistim" }; struct ast_frame f = { .frametype = AST_FRAME_DTMF, .subclass.integer = digit, .src = "unistim" };
struct unistim_subchannel *sub; struct unistim_subchannel *sub;
@ -2057,7 +2042,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
ast_log(LOG_WARNING, "Unable to find subchannel in dtmf senddigit\n"); ast_log(LOG_WARNING, "Unable to find subchannel in dtmf senddigit\n");
return -1; return -1;
} }
@@ -2527,65 +3085,78 @@ static int unistim_do_senddigit(struct unistimsession @@ -2526,65 +3084,78 @@ static int unistim_do_senddigit(struct unistimsession
if (unistimdebug) if (unistimdebug)
ast_verb(0, "Send Digit %c\n", digit); ast_verb(0, "Send Digit %c\n", digit);
@ -2188,7 +2173,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
if ((keycode >= KEY_0) && (keycode <= KEY_SHARP)) { if ((keycode >= KEY_0) && (keycode <= KEY_SHARP)) {
if (keycode == KEY_SHARP) if (keycode == KEY_SHARP)
keycode = '#'; keycode = '#';
@@ -2602,9 +3173,17 @@ static void key_call(struct unistimsession *pte, char @@ -2601,9 +3172,17 @@ static void key_call(struct unistimsession *pte, char
close_call(pte); close_call(pte);
break; break;
case KEY_FUNC2: case KEY_FUNC2:
@ -2208,7 +2193,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
if (pte->device->output == OUTPUT_HEADPHONE) if (pte->device->output == OUTPUT_HEADPHONE)
send_select_output(pte, OUTPUT_HANDSET, pte->device->volume, MUTE_OFF); send_select_output(pte, OUTPUT_HANDSET, pte->device->volume, MUTE_OFF);
else else
@@ -2618,82 +3197,71 @@ static void key_call(struct unistimsession *pte, char @@ -2617,82 +3196,71 @@ static void key_call(struct unistimsession *pte, char
MUTE_OFF); MUTE_OFF);
break; break;
case KEY_MUTE: case KEY_MUTE:
@ -2331,7 +2316,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
if (keycode == KEY_FUNC3) { if (keycode == KEY_FUNC3) {
if (pte->device->size_phone_number <= 1) if (pte->device->size_phone_number <= 1)
keycode = KEY_FUNC4; keycode = KEY_FUNC4;
@@ -2702,50 +3270,32 @@ static void key_dial_page(struct unistimsession *pte, @@ -2701,50 +3269,32 @@ static void key_dial_page(struct unistimsession *pte,
keycode = pte->device->phone_number[pte->device->size_phone_number] + 0x10; keycode = pte->device->phone_number[pte->device->size_phone_number] + 0x10;
} }
} }
@ -2393,7 +2378,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
} }
if (pte->device->call_forward[0] == -1) { if (pte->device->call_forward[0] == -1) {
@@ -2755,7 +3305,9 @@ static void key_dial_page(struct unistimsession *pte, @@ -2754,7 +3304,9 @@ static void key_dial_page(struct unistimsession *pte,
show_main_page(pte); show_main_page(pte);
} else if ((keycode == KEY_FUNC2) || (keycode == KEY_HANGUP)) { } else if ((keycode == KEY_FUNC2) || (keycode == KEY_HANGUP)) {
pte->device->call_forward[0] = '\0'; pte->device->call_forward[0] = '\0';
@ -2404,7 +2389,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
} }
return; return;
} }
@@ -2766,40 +3318,43 @@ static void key_dial_page(struct unistimsession *pte, @@ -2765,40 +3317,43 @@ static void key_dial_page(struct unistimsession *pte,
ast_copy_string(pte->device->phone_number, pte->device->redial_number, ast_copy_string(pte->device->phone_number, pte->device->redial_number,
sizeof(pte->device->phone_number)); sizeof(pte->device->phone_number));
case KEY_FUNC1: case KEY_FUNC1:
@ -2469,7 +2454,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
break; break;
case KEY_LOUDSPK: case KEY_LOUDSPK:
if (pte->device->output == OUTPUT_SPEAKER) { if (pte->device->output == OUTPUT_SPEAKER) {
@@ -2824,10 +3379,50 @@ static void key_dial_page(struct unistimsession *pte, @@ -2823,10 +3378,50 @@ static void key_dial_page(struct unistimsession *pte,
return; return;
} }
@ -2521,7 +2506,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
{ {
char buf[30], buf2[5]; char buf[30], buf2[5];
@@ -2843,7 +3438,7 @@ static void HandleSelectCodec(struct unistimsession *p @@ -2842,7 +3437,7 @@ static void HandleSelectCodec(struct unistimsession *p
send_blink_cursor(pte); send_blink_cursor(pte);
send_cursor_pos(pte, TEXT_LINE2 + SELECTCODEC_START_ENTRY_POS); send_cursor_pos(pte, TEXT_LINE2 + SELECTCODEC_START_ENTRY_POS);
pte->size_buff_entry = 0; pte->size_buff_entry = 0;
@ -2530,7 +2515,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
return; return;
} }
@@ -2901,19 +3496,110 @@ static void key_select_codec(struct unistimsession *pt @@ -2900,19 +3495,110 @@ static void key_select_codec(struct unistimsession *pt
return; return;
} }
@ -2645,7 +2630,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
pte->size_buff_entry = 0; pte->size_buff_entry = 0;
return; return;
} }
@@ -2985,8 +3671,8 @@ static void key_select_extension(struct unistimsession @@ -2984,8 +3670,8 @@ static void key_select_extension(struct unistimsession
d = d->next; d = d->next;
} }
ast_mutex_unlock(&devicelock); ast_mutex_unlock(&devicelock);
@ -2656,7 +2641,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
send_cursor_pos(pte, send_cursor_pos(pte,
(unsigned char) (TEXT_LINE2 + SELECTEXTENSION_START_ENTRY_POS + (unsigned char) (TEXT_LINE2 + SELECTEXTENSION_START_ENTRY_POS +
pte->size_buff_entry)); pte->size_buff_entry));
@@ -2994,9 +3680,9 @@ static void key_select_extension(struct unistimsession @@ -2993,9 +3679,9 @@ static void key_select_extension(struct unistimsession
} else { } else {
ast_copy_string(pte->device->extension_number, pte->buff_entry, ast_copy_string(pte->device->extension_number, pte->buff_entry,
pte->size_buff_entry + 1); pte->size_buff_entry + 1);
@ -2669,7 +2654,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
send_cursor_pos(pte, send_cursor_pos(pte,
(unsigned char) (TEXT_LINE2 + (unsigned char) (TEXT_LINE2 +
SELECTEXTENSION_START_ENTRY_POS + SELECTEXTENSION_START_ENTRY_POS +
@@ -3016,12 +3702,13 @@ static void key_select_extension(struct unistimsession @@ -3015,12 +3701,13 @@ static void key_select_extension(struct unistimsession
return; return;
} }
@ -2685,7 +2670,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
if (i == pos) { if (i == pos) {
pos++; pos++;
continue; continue;
@@ -3045,22 +3732,37 @@ static void show_entry_history(struct unistimsession * @@ -3044,22 +3731,37 @@ static void show_entry_history(struct unistimsession *
return; return;
} }
line[sizeof(line) - 1] = '\0'; line[sizeof(line) - 1] = '\0';
@ -2728,7 +2713,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
fclose(*f); fclose(*f);
snprintf(line, sizeof(line), "Call %03d/%03d", pte->buff_entry[2], snprintf(line, sizeof(line), "Call %03d/%03d", pte->buff_entry[2],
@@ -3070,20 +3772,20 @@ static void show_entry_history(struct unistimsession * @@ -3069,20 +3771,20 @@ static void show_entry_history(struct unistimsession *
if (pte->buff_entry[2] == 1) if (pte->buff_entry[2] == 1)
strcpy(func1, " "); strcpy(func1, " ");
else else
@ -2755,7 +2740,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
{ {
char tmp[AST_CONFIG_MAX_PATH]; char tmp[AST_CONFIG_MAX_PATH];
char count; char count;
@@ -3118,12 +3820,13 @@ static void show_history(struct unistimsession *pte, c @@ -3117,12 +3819,13 @@ static void show_history(struct unistimsession *pte, c
return; return;
if (!pte->device->callhistory) if (!pte->device->callhistory)
return; return;
@ -2770,7 +2755,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
show_entry_history(pte, &f); show_entry_history(pte, &f);
pte->state = STATE_HISTORY; pte->state = STATE_HISTORY;
} }
@@ -3131,60 +3834,73 @@ static void show_history(struct unistimsession *pte, c @@ -3130,60 +3833,73 @@ static void show_history(struct unistimsession *pte, c
static void show_main_page(struct unistimsession *pte) static void show_main_page(struct unistimsession *pte)
{ {
char tmpbuf[TEXT_LENGTH_MAX + 1]; char tmpbuf[TEXT_LENGTH_MAX + 1];
@ -2869,7 +2854,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
pte->device->missed_call = 0; pte->device->missed_call = 0;
} }
if ((keycode >= KEY_0) && (keycode <= KEY_SHARP)) { if ((keycode >= KEY_0) && (keycode <= KEY_SHARP)) {
@@ -3194,6 +3910,7 @@ static void key_main_page(struct unistimsession *pte, @@ -3193,6 +3909,7 @@ static void key_main_page(struct unistimsession *pte,
} }
switch (keycode) { switch (keycode) {
case KEY_FUNC1: case KEY_FUNC1:
@ -2877,7 +2862,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
handle_dial_page(pte); handle_dial_page(pte);
break; break;
case KEY_FUNC2: case KEY_FUNC2:
@@ -3207,7 +3924,7 @@ static void key_main_page(struct unistimsession *pte, @@ -3206,7 +3923,7 @@ static void key_main_page(struct unistimsession *pte,
ast_copy_string(pte->device->phone_number, pte->device->redial_number, ast_copy_string(pte->device->phone_number, pte->device->redial_number,
sizeof(pte->device->phone_number)); sizeof(pte->device->phone_number));
@ -2886,7 +2871,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
break; break;
case KEY_FUNC3: case KEY_FUNC3:
if (!ast_strlen_zero(pte->device->call_forward)) { if (!ast_strlen_zero(pte->device->call_forward)) {
@@ -3215,7 +3932,7 @@ static void key_main_page(struct unistimsession *pte, @@ -3214,7 +3931,7 @@ static void key_main_page(struct unistimsession *pte,
memmove(pte->device->call_forward + 1, pte->device->call_forward, memmove(pte->device->call_forward + 1, pte->device->call_forward,
sizeof(pte->device->call_forward)); sizeof(pte->device->call_forward));
pte->device->call_forward[0] = '\0'; pte->device->call_forward[0] = '\0';
@ -2895,7 +2880,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
pte->device->output = OUTPUT_HANDSET; /* Seems to be reseted somewhere */ pte->device->output = OUTPUT_HANDSET; /* Seems to be reseted somewhere */
show_main_page(pte); show_main_page(pte);
break; break;
@@ -3225,9 +3942,9 @@ static void key_main_page(struct unistimsession *pte, @@ -3224,9 +3941,9 @@ static void key_main_page(struct unistimsession *pte,
break; break;
case KEY_FUNC4: case KEY_FUNC4:
if (pte->device->extension == EXTENSION_ASK) { if (pte->device->extension == EXTENSION_ASK) {
@ -2907,7 +2892,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
} else if (pte->device->extension == EXTENSION_TN) { } else if (pte->device->extension == EXTENSION_TN) {
ast_mutex_lock(&devicelock); ast_mutex_lock(&devicelock);
strcpy(pte->device->id, pte->device->extension_number); strcpy(pte->device->id, pte->device->extension_number);
@@ -3236,26 +3953,25 @@ static void key_main_page(struct unistimsession *pte, @@ -3235,26 +3952,25 @@ static void key_main_page(struct unistimsession *pte,
pte->device->session = NULL; pte->device->session = NULL;
pte->device = NULL; pte->device = NULL;
ast_mutex_unlock(&devicelock); ast_mutex_unlock(&devicelock);
@ -2945,7 +2930,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
break; break;
case KEY_LOUDSPK: case KEY_LOUDSPK:
send_select_output(pte, OUTPUT_SPEAKER, pte->device->volume, MUTE_OFF); send_select_output(pte, OUTPUT_SPEAKER, pte->device->volume, MUTE_OFF);
@@ -3280,44 +3996,41 @@ static void key_history(struct unistimsession *pte, ch @@ -3279,44 +3995,41 @@ static void key_history(struct unistimsession *pte, ch
FILE *f; FILE *f;
char count; char count;
long offset; long offset;
@ -3011,7 +2996,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
break; break;
ast_copy_string(pte->device->redial_number, pte->device->lst_cid, ast_copy_string(pte->device->redial_number, pte->device->lst_cid,
sizeof(pte->device->redial_number)); sizeof(pte->device->redial_number));
@@ -3340,6 +4053,20 @@ static void key_history(struct unistimsession *pte, ch @@ -3339,6 +4052,20 @@ static void key_history(struct unistimsession *pte, ch
show_history(pte, 'i'); show_history(pte, 'i');
break; break;
} }
@ -3032,7 +3017,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
return; return;
} }
@@ -3350,7 +4077,7 @@ static void init_phone_step2(struct unistimsession *pt @@ -3349,7 +4076,7 @@ static void init_phone_step2(struct unistimsession *pt
ast_verb(0, "Sending S4\n"); ast_verb(0, "Sending S4\n");
memcpy(buffsend + SIZE_HEADER, packet_send_s4, sizeof(packet_send_s4)); memcpy(buffsend + SIZE_HEADER, packet_send_s4, sizeof(packet_send_s4));
send_client(SIZE_HEADER + sizeof(packet_send_s4), buffsend, pte); send_client(SIZE_HEADER + sizeof(packet_send_s4), buffsend, pte);
@ -3041,7 +3026,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
send_date_time3(pte); send_date_time3(pte);
if (unistimdebug) if (unistimdebug)
ast_verb(0, "Sending S7\n"); ast_verb(0, "Sending S7\n");
@@ -3375,9 +4102,13 @@ static void init_phone_step2(struct unistimsession *pt @@ -3374,9 +4101,13 @@ static void init_phone_step2(struct unistimsession *pt
send_client(SIZE_HEADER + sizeof(packet_send_S7), buffsend, pte); send_client(SIZE_HEADER + sizeof(packet_send_S7), buffsend, pte);
send_led_update(pte, 0); send_led_update(pte, 0);
send_ping(pte); send_ping(pte);
@ -3057,7 +3042,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
return; return;
} else { } else {
int i; int i;
@@ -3385,8 +4116,8 @@ static void init_phone_step2(struct unistimsession *pt @@ -3384,8 +4115,8 @@ static void init_phone_step2(struct unistimsession *pt
for (i = 1; i < 6; i++) for (i = 1; i < 6; i++)
send_favorite(i, 0, pte, ""); send_favorite(i, 0, pte, "");
@ -3068,7 +3053,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
strcpy(tmp, "MAC = "); strcpy(tmp, "MAC = ");
strcat(tmp, pte->macaddr); strcat(tmp, pte->macaddr);
send_text(TEXT_LINE2, TEXT_NORMAL, pte, tmp); send_text(TEXT_LINE2, TEXT_NORMAL, pte, tmp);
@@ -3440,8 +4171,8 @@ static void process_request(int size, unsigned char *b @@ -3439,8 +4170,8 @@ static void process_request(int size, unsigned char *b
char keycode = buf[13]; char keycode = buf[13];
if (unistimdebug) if (unistimdebug)
@ -3079,7 +3064,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
switch (pte->state) { switch (pte->state) {
case STATE_INIT: case STATE_INIT:
@@ -3467,10 +4198,19 @@ static void process_request(int size, unsigned char *b @@ -3466,10 +4197,19 @@ static void process_request(int size, unsigned char *b
case STATE_EXTENSION: case STATE_EXTENSION:
key_select_extension(pte, keycode); key_select_extension(pte, keycode);
break; break;
@ -3100,7 +3085,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
key_history(pte, keycode); key_history(pte, keycode);
break; break;
default: default:
@@ -3488,13 +4228,15 @@ static void process_request(int size, unsigned char *b @@ -3487,13 +4227,15 @@ static void process_request(int size, unsigned char *b
send_select_output(pte, OUTPUT_HEADPHONE, pte->device->volume, MUTE_OFF); send_select_output(pte, OUTPUT_HEADPHONE, pte->device->volume, MUTE_OFF);
else else
send_select_output(pte, OUTPUT_HANDSET, pte->device->volume, MUTE_OFF); send_select_output(pte, OUTPUT_HANDSET, pte->device->volume, MUTE_OFF);
@ -3119,7 +3104,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
send_select_output(pte, OUTPUT_HANDSET, pte->device->volume, MUTE_OFF); send_select_output(pte, OUTPUT_HANDSET, pte->device->volume, MUTE_OFF);
handle_dial_page(pte); handle_dial_page(pte);
} }
@@ -3508,7 +4250,7 @@ static void process_request(int size, unsigned char *b @@ -3507,7 +4249,7 @@ static void process_request(int size, unsigned char *b
pte->device->receiver_state = STATE_ONHOOK; pte->device->receiver_state = STATE_ONHOOK;
if (pte->state == STATE_CALL) if (pte->state == STATE_CALL)
close_call(pte); close_call(pte);
@ -3128,7 +3113,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
close_call(pte); close_call(pte);
else if (pte->state == STATE_EXTENSION) else if (pte->state == STATE_EXTENSION)
return; return;
@@ -3706,13 +4448,52 @@ static struct unistimsession *channel_to_session(struc @@ -3705,13 +4447,52 @@ static struct unistimsession *channel_to_session(struc
return sub->parent->parent->session; return sub->parent->parent->session;
} }
@ -3183,7 +3168,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
session = channel_to_session(ast); session = channel_to_session(ast);
if (!session) { if (!session) {
@@ -3721,6 +4502,7 @@ static int unistim_call(struct ast_channel *ast, char @@ -3720,6 +4501,7 @@ static int unistim_call(struct ast_channel *ast, char
} }
sub = ast->tech_pvt; sub = ast->tech_pvt;
@ -3191,7 +3176,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
if ((ast->_state != AST_STATE_DOWN) && (ast->_state != AST_STATE_RESERVED)) { if ((ast->_state != AST_STATE_DOWN) && (ast->_state != AST_STATE_RESERVED)) {
ast_log(LOG_WARNING, "unistim_call called on %s, neither down nor reserved\n", ast_log(LOG_WARNING, "unistim_call called on %s, neither down nor reserved\n",
ast->name); ast->name);
@@ -3731,58 +4513,49 @@ static int unistim_call(struct ast_channel *ast, char @@ -3730,58 +4512,49 @@ static int unistim_call(struct ast_channel *ast, char
ast_verb(3, "unistim_call(%s)\n", ast->name); ast_verb(3, "unistim_call(%s)\n", ast->name);
session->state = STATE_RINGING; session->state = STATE_RINGING;
@ -3285,7 +3270,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
s = channel_to_session(ast); s = channel_to_session(ast);
sub = ast->tech_pvt; sub = ast->tech_pvt;
@@ -3802,32 +4575,43 @@ static int unistim_hangup(struct ast_channel *ast) @@ -3801,32 +4574,43 @@ static int unistim_hangup(struct ast_channel *ast)
return 0; return 0;
} }
l = sub->parent; l = sub->parent;
@ -3342,7 +3327,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
return 0; return 0;
} }
ast_mutex_lock(&sub->lock); ast_mutex_lock(&sub->lock);
@@ -3835,34 +4619,26 @@ static int unistim_hangup(struct ast_channel *ast) @@ -3834,34 +4618,26 @@ static int unistim_hangup(struct ast_channel *ast)
ast->tech_pvt = NULL; ast->tech_pvt = NULL;
sub->alreadygone = 0; sub->alreadygone = 0;
ast_mutex_unlock(&sub->lock); ast_mutex_unlock(&sub->lock);
@ -3396,7 +3381,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
if (sub->rtp) { if (sub->rtp) {
if (unistimdebug) if (unistimdebug)
ast_verb(0, "Destroying RTP session\n"); ast_verb(0, "Destroying RTP session\n");
@@ -3870,16 +4646,27 @@ static int unistim_hangup(struct ast_channel *ast) @@ -3869,16 +4645,27 @@ static int unistim_hangup(struct ast_channel *ast)
sub->rtp = NULL; sub->rtp = NULL;
} else if (unistimdebug) } else if (unistimdebug)
ast_verb(0, "No RTP session to destroy\n"); ast_verb(0, "No RTP session to destroy\n");
@ -3434,7 +3419,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
return 0; return 0;
} }
@@ -3889,6 +4676,7 @@ static int unistim_answer(struct ast_channel *ast) @@ -3888,6 +4675,7 @@ static int unistim_answer(struct ast_channel *ast)
int res = 0; int res = 0;
struct unistim_subchannel *sub; struct unistim_subchannel *sub;
struct unistim_line *l; struct unistim_line *l;
@ -3442,7 +3427,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
struct unistimsession *s; struct unistimsession *s;
s = channel_to_session(ast); s = channel_to_session(ast);
@@ -3898,18 +4686,19 @@ static int unistim_answer(struct ast_channel *ast) @@ -3897,18 +4685,19 @@ static int unistim_answer(struct ast_channel *ast)
} }
sub = ast->tech_pvt; sub = ast->tech_pvt;
l = sub->parent; l = sub->parent;
@ -3469,7 +3454,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
if (ast->_state != AST_STATE_UP) if (ast->_state != AST_STATE_UP)
ast_setstate(ast, AST_STATE_UP); ast_setstate(ast, AST_STATE_UP);
return res; return res;
@@ -4047,14 +4836,16 @@ static int unistim_write(struct ast_channel *ast, stru @@ -4046,14 +4835,16 @@ static int unistim_write(struct ast_channel *ast, stru
return 0; return 0;
} }
} else { } else {
@ -3489,7 +3474,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
return -1; return -1;
} }
} }
@@ -4123,7 +4914,13 @@ static char *control2str(int ind) @@ -4122,7 +4913,13 @@ static char *control2str(int ind)
return "Key Radio"; return "Key Radio";
case AST_CONTROL_RADIO_UNKEY: case AST_CONTROL_RADIO_UNKEY:
return "Un-Key Radio"; return "Un-Key Radio";
@ -3504,7 +3489,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
return "Stop tone"; return "Stop tone";
} }
return "UNKNOWN"; return "UNKNOWN";
@@ -4150,8 +4947,8 @@ static int unistim_indicate(struct ast_channel *ast, i @@ -4149,8 +4946,8 @@ static int unistim_indicate(struct ast_channel *ast, i
struct unistimsession *s; struct unistimsession *s;
if (unistimdebug) { if (unistimdebug) {
@ -3515,7 +3500,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
} }
s = channel_to_session(ast); s = channel_to_session(ast);
@@ -4164,7 +4961,7 @@ static int unistim_indicate(struct ast_channel *ast, i @@ -4163,7 +4960,7 @@ static int unistim_indicate(struct ast_channel *ast, i
switch (ind) { switch (ind) {
case AST_CONTROL_RINGING: case AST_CONTROL_RINGING:
if (ast->_state != AST_STATE_UP) { if (ast->_state != AST_STATE_UP) {
@ -3524,7 +3509,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
in_band_indication(ast, l->parent->tz, "ring"); in_band_indication(ast, l->parent->tz, "ring");
s->device->missed_call = -1; s->device->missed_call = -1;
break; break;
@@ -4173,7 +4970,7 @@ static int unistim_indicate(struct ast_channel *ast, i @@ -4172,7 +4969,7 @@ static int unistim_indicate(struct ast_channel *ast, i
case AST_CONTROL_BUSY: case AST_CONTROL_BUSY:
if (ast->_state != AST_STATE_UP) { if (ast->_state != AST_STATE_UP) {
sub->alreadygone = 1; sub->alreadygone = 1;
@ -3533,7 +3518,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
in_band_indication(ast, l->parent->tz, "busy"); in_band_indication(ast, l->parent->tz, "busy");
s->device->missed_call = -1; s->device->missed_call = -1;
break; break;
@@ -4182,7 +4979,7 @@ static int unistim_indicate(struct ast_channel *ast, i @@ -4181,7 +4978,7 @@ static int unistim_indicate(struct ast_channel *ast, i
case AST_CONTROL_CONGESTION: case AST_CONTROL_CONGESTION:
if (ast->_state != AST_STATE_UP) { if (ast->_state != AST_STATE_UP) {
sub->alreadygone = 1; sub->alreadygone = 1;
@ -3542,7 +3527,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
in_band_indication(ast, l->parent->tz, "congestion"); in_band_indication(ast, l->parent->tz, "congestion");
s->device->missed_call = -1; s->device->missed_call = -1;
break; break;
@@ -4196,13 +4993,23 @@ static int unistim_indicate(struct ast_channel *ast, i @@ -4195,13 +4992,23 @@ static int unistim_indicate(struct ast_channel *ast, i
break; break;
case AST_CONTROL_PROGRESS: case AST_CONTROL_PROGRESS:
case AST_CONTROL_SRCUPDATE: case AST_CONTROL_SRCUPDATE:
@ -3568,7 +3553,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
default: default:
ast_log(LOG_WARNING, "Don't know how to indicate condition %d\n", ind); ast_log(LOG_WARNING, "Don't know how to indicate condition %d\n", ind);
return -1; return -1;
@@ -4215,6 +5022,7 @@ static struct unistim_subchannel *find_subchannel_by_n @@ -4214,6 +5021,7 @@ static struct unistim_subchannel *find_subchannel_by_n
{ {
struct unistim_line *l; struct unistim_line *l;
struct unistim_device *d; struct unistim_device *d;
@ -3576,7 +3561,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
char line[256]; char line[256];
char *at; char *at;
char *device; char *device;
@@ -4238,12 +5046,22 @@ static struct unistim_subchannel *find_subchannel_by_n @@ -4237,12 +5045,22 @@ static struct unistim_subchannel *find_subchannel_by_n
if (unistimdebug) if (unistimdebug)
ast_verb(0, "Found device: %s\n", d->name); ast_verb(0, "Found device: %s\n", d->name);
/* Found the device */ /* Found the device */
@ -3603,7 +3588,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
if (at) { /* Other options ? */ if (at) { /* Other options ? */
at++; /* Skip slash */ at++; /* Skip slash */
if (*at == 'r') { /* distinctive ring */ if (*at == 'r') { /* distinctive ring */
@@ -4259,16 +5077,20 @@ static struct unistim_subchannel *find_subchannel_by_n @@ -4258,16 +5076,20 @@ static struct unistim_subchannel *find_subchannel_by_n
if (unistimdebug) if (unistimdebug)
ast_verb(0, "Distinctive ring : style #%d volume %d\n", ast_verb(0, "Distinctive ring : style #%d volume %d\n",
ring_style, ring_volume); ring_style, ring_volume);
@ -3629,7 +3614,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
} }
d = d->next; d = d->next;
} }
@@ -4294,7 +5116,7 @@ static int unistim_senddigit_end(struct ast_channel *a @@ -4293,7 +5115,7 @@ static int unistim_senddigit_end(struct ast_channel *a
struct ast_frame f = { 0, }; struct ast_frame f = { 0, };
struct unistim_subchannel *sub; struct unistim_subchannel *sub;
@ -3638,7 +3623,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
if (!sub->owner || sub->alreadygone) { if (!sub->owner || sub->alreadygone) {
ast_log(LOG_WARNING, "Unable to find subchannel in dtmf senddigit_end\n"); ast_log(LOG_WARNING, "Unable to find subchannel in dtmf senddigit_end\n");
@@ -4429,7 +5251,7 @@ static int unistim_sendtext(struct ast_channel *ast, c @@ -4428,7 +5250,7 @@ static int unistim_sendtext(struct ast_channel *ast, c
if (pte->device->height == 1) { if (pte->device->height == 1) {
send_text(TEXT_LINE0, TEXT_NORMAL, pte, text); send_text(TEXT_LINE0, TEXT_NORMAL, pte, text);
} else { } else {
@ -3647,7 +3632,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
send_text(TEXT_LINE1, TEXT_NORMAL, pte, text); send_text(TEXT_LINE1, TEXT_NORMAL, pte, text);
} }
if (size <= TEXT_LENGTH_MAX) { if (size <= TEXT_LENGTH_MAX) {
@@ -4457,7 +5279,7 @@ static int unistim_send_mwi_to_peer(struct unistimsess @@ -4456,7 +5278,7 @@ static int unistim_send_mwi_to_peer(struct unistimsess
struct ast_event *event; struct ast_event *event;
int new; int new;
char *mailbox, *context; char *mailbox, *context;
@ -3656,7 +3641,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
context = mailbox = ast_strdupa(peer->mailbox); context = mailbox = ast_strdupa(peer->mailbox);
strsep(&context, "@"); strsep(&context, "@");
@@ -4511,9 +5333,9 @@ static struct ast_channel *unistim_new(struct unistim_ @@ -4510,9 +5332,9 @@ static struct ast_channel *unistim_new(struct unistim_
} }
l = sub->parent; l = sub->parent;
tmp = ast_channel_alloc(1, state, l->cid_num, NULL, l->accountcode, l->exten, tmp = ast_channel_alloc(1, state, l->cid_num, NULL, l->accountcode, l->exten,
@ -3668,7 +3653,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
if (!tmp) { if (!tmp) {
ast_log(LOG_WARNING, "Unable to allocate channel structure\n"); ast_log(LOG_WARNING, "Unable to allocate channel structure\n");
return NULL; return NULL;
@@ -4551,8 +5373,8 @@ static struct ast_channel *unistim_new(struct unistim_ @@ -4550,8 +5372,8 @@ static struct ast_channel *unistim_new(struct unistim_
tmp->rawreadformat = fmt; tmp->rawreadformat = fmt;
tmp->tech_pvt = sub; tmp->tech_pvt = sub;
tmp->tech = &unistim_tech; tmp->tech = &unistim_tech;
@ -3679,7 +3664,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
sub->owner = tmp; sub->owner = tmp;
ast_mutex_lock(&usecnt_lock); ast_mutex_lock(&usecnt_lock);
usecnt++; usecnt++;
@@ -4576,14 +5398,14 @@ static struct ast_channel *unistim_new(struct unistim_ @@ -4575,14 +5397,14 @@ static struct ast_channel *unistim_new(struct unistim_
} }
} }
tmp->priority = 1; tmp->priority = 1;
@ -3702,7 +3687,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
} }
return tmp; return tmp;
@@ -4632,8 +5454,8 @@ static void *do_monitor(void *data) @@ -4631,8 +5453,8 @@ static void *do_monitor(void *data)
dw_timeout = cur->timeout - tick; dw_timeout = cur->timeout - tick;
/* Checking if the phone is logged on for a new MWI */ /* Checking if the phone is logged on for a new MWI */
if (cur->device) { if (cur->device) {
@ -3713,7 +3698,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
DEBUG_TIMER("Checking mailbox for MWI\n"); DEBUG_TIMER("Checking mailbox for MWI\n");
unistim_send_mwi_to_peer(cur, tick); unistim_send_mwi_to_peer(cur, tick);
break; break;
@@ -4703,7 +5525,8 @@ static struct ast_channel *unistim_request(const char @@ -4702,7 +5524,8 @@ static struct ast_channel *unistim_request(const char
int *cause) int *cause)
{ {
format_t oldformat; format_t oldformat;
@ -3723,7 +3708,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
struct ast_channel *tmpc = NULL; struct ast_channel *tmpc = NULL;
char tmp[256]; char tmp[256];
char *dest = data; char *dest = data;
@@ -4727,22 +5550,39 @@ static struct ast_channel *unistim_request(const char @@ -4726,22 +5549,39 @@ static struct ast_channel *unistim_request(const char
ast_log(LOG_NOTICE, "Unistim channels require a device\n"); ast_log(LOG_NOTICE, "Unistim channels require a device\n");
return NULL; return NULL;
} }
@ -3769,7 +3754,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
sub->parent->capability = format; sub->parent->capability = format;
tmpc = unistim_new(sub, AST_STATE_DOWN, requestor ? requestor->linkedid : NULL); tmpc = unistim_new(sub, AST_STATE_DOWN, requestor ? requestor->linkedid : NULL);
if (!tmpc) if (!tmpc)
@@ -4761,7 +5601,6 @@ static char *unistim_info(struct ast_cli_entry *e, int @@ -4760,7 +5600,6 @@ static char *unistim_info(struct ast_cli_entry *e, int
struct unistim_line *line; struct unistim_line *line;
struct unistim_subchannel *sub; struct unistim_subchannel *sub;
struct unistimsession *s; struct unistimsession *s;
@ -3777,7 +3762,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
struct ast_channel *tmp; struct ast_channel *tmp;
switch (cmd) { switch (cmd) {
@@ -4779,44 +5618,55 @@ static char *unistim_info(struct ast_cli_entry *e, int @@ -4778,44 +5617,55 @@ static char *unistim_info(struct ast_cli_entry *e, int
if (a->argc != e->args) if (a->argc != e->args)
return CLI_SHOWUSAGE; return CLI_SHOWUSAGE;
@ -3861,7 +3846,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
s->device, s); s->device, s);
s = s->next; s = s->next;
} }
@@ -4974,7 +5824,7 @@ static void unquote(char *out, const char *src, int ma @@ -4973,7 +5823,7 @@ static void unquote(char *out, const char *src, int ma
return; return;
} }
@ -3870,7 +3855,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
{ {
char line[256]; char line[256];
char *at; char *at;
@@ -5049,7 +5899,7 @@ static int ParseBookmark(const char *text, struct unis @@ -5048,7 +5898,7 @@ static int ParseBookmark(const char *text, struct unis
ast_copy_string(d->softkeylabel[p], line, sizeof(d->softkeylabel[p])); ast_copy_string(d->softkeylabel[p], line, sizeof(d->softkeylabel[p]));
ast_copy_string(d->softkeynumber[p], number, sizeof(d->softkeynumber[p])); ast_copy_string(d->softkeynumber[p], number, sizeof(d->softkeynumber[p]));
if (unistimdebug) if (unistimdebug)
@ -3879,7 +3864,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
p, d->softkeylabel[p], d->softkeynumber[p], d->softkeyicon[p]); p, d->softkeylabel[p], d->softkeynumber[p], d->softkeyicon[p]);
return 1; return 1;
} }
@@ -5080,15 +5930,29 @@ static void finish_bookmark(void) @@ -5079,15 +5929,29 @@ static void finish_bookmark(void)
} }
} }
@ -3912,7 +3897,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
/* First, we need to know if we already have this name in our list */ /* First, we need to know if we already have this name in our list */
/* Get a lock for the device chained list */ /* Get a lock for the device chained list */
@@ -5105,22 +5969,39 @@ static struct unistim_device *build_device(const char @@ -5104,22 +5968,39 @@ static struct unistim_device *build_device(const char
} }
/* we're reloading right now */ /* we're reloading right now */
create = 0; create = 0;
@ -3959,7 +3944,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
ast_copy_string(context, DEFAULTCONTEXT, sizeof(context)); ast_copy_string(context, DEFAULTCONTEXT, sizeof(context));
d->contrast = -1; d->contrast = -1;
d->output = OUTPUT_HANDSET; d->output = OUTPUT_HANDSET;
@@ -5128,12 +6009,16 @@ static struct unistim_device *build_device(const char @@ -5127,12 +6008,16 @@ static struct unistim_device *build_device(const char
d->volume = VOLUME_LOW; d->volume = VOLUME_LOW;
d->mute = MUTE_OFF; d->mute = MUTE_OFF;
d->height = DEFAULTHEIGHT; d->height = DEFAULTHEIGHT;
@ -3976,7 +3961,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
nbsoftkey = 0; nbsoftkey = 0;
while (v) { while (v) {
if (!strcasecmp(v->name, "rtp_port")) if (!strcasecmp(v->name, "rtp_port"))
@@ -5174,19 +6059,25 @@ static struct unistim_device *build_device(const char @@ -5173,19 +6058,25 @@ static struct unistim_device *build_device(const char
ringvolume = atoi(v->value); ringvolume = atoi(v->value);
else if (!strcasecmp(v->name, "ringstyle")) else if (!strcasecmp(v->name, "ringstyle"))
ringstyle = atoi(v->value); ringstyle = atoi(v->value);
@ -4008,7 +3993,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
else if (!strcasecmp(v->name, "amaflags")) { else if (!strcasecmp(v->name, "amaflags")) {
int y; int y;
y = ast_cdr_amaflags2int(v->value); y = ast_cdr_amaflags2int(v->value);
@@ -5194,17 +6085,17 @@ static struct unistim_device *build_device(const char @@ -5193,17 +6084,17 @@ static struct unistim_device *build_device(const char
ast_log(LOG_WARNING, "Invalid AMA flags: %s at line %d\n", v->value, ast_log(LOG_WARNING, "Invalid AMA flags: %s at line %d\n", v->value,
v->lineno); v->lineno);
else else
@ -4032,7 +4017,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
else if (!strcasecmp(v->name, "linelabel")) else if (!strcasecmp(v->name, "linelabel"))
unquote(linelabel, v->value, sizeof(linelabel) - 1); unquote(linelabel, v->value, sizeof(linelabel) - 1);
else if (!strcasecmp(v->name, "extension")) { else if (!strcasecmp(v->name, "extension")) {
@@ -5221,103 +6112,93 @@ static struct unistim_device *build_device(const char @@ -5220,103 +6111,93 @@ static struct unistim_device *build_device(const char
ast_log(LOG_WARNING, ast_log(LOG_WARNING,
"More than 6 softkeys defined. Ignoring new entries.\n"); "More than 6 softkeys defined. Ignoring new entries.\n");
else { else {
@ -4193,7 +4178,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
if ((autoprovisioning == AUTOPROVISIONING_TN) && if ((autoprovisioning == AUTOPROVISIONING_TN) &&
(!ast_strlen_zero(d->extension_number))) { (!ast_strlen_zero(d->extension_number))) {
d->extension = EXTENSION_TN; d->extension = EXTENSION_TN;
@@ -5330,8 +6211,6 @@ static struct unistim_device *build_device(const char @@ -5329,8 +6210,6 @@ static struct unistim_device *build_device(const char
} else if (ast_strlen_zero(d->id)) { } else if (ast_strlen_zero(d->id)) {
if (strcmp(d->name, "template")) { if (strcmp(d->name, "template")) {
ast_log(LOG_ERROR, "You must specify the mac address with device=\n"); ast_log(LOG_ERROR, "You must specify the mac address with device=\n");
@ -4202,7 +4187,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
if (d->tz) { if (d->tz) {
d->tz = ast_tone_zone_unref(d->tz); d->tz = ast_tone_zone_unref(d->tz);
} }
@@ -5344,8 +6223,6 @@ static struct unistim_device *build_device(const char @@ -5343,8 +6222,6 @@ static struct unistim_device *build_device(const char
d->rtp_port = 10000; d->rtp_port = 10000;
if (d->contrast == -1) if (d->contrast == -1)
d->contrast = 8; d->contrast = 8;
@ -4211,7 +4196,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
if (ast_strlen_zero(d->maintext1)) if (ast_strlen_zero(d->maintext1))
strcpy(d->maintext1, d->name); strcpy(d->maintext1, d->name);
if (ast_strlen_zero(d->titledefault)) { if (ast_strlen_zero(d->titledefault)) {
@@ -5431,8 +6308,13 @@ static int reload_config(void) @@ -5430,8 +6307,13 @@ static int reload_config(void)
} else if (!strcasecmp(v->name, "cos_audio")) { } else if (!strcasecmp(v->name, "cos_audio")) {
if (ast_str2cos(v->value, &qos.cos_audio)) if (ast_str2cos(v->value, &qos.cos_audio))
ast_log(LOG_WARNING, "Invalid cos_audio value at line %d, refer to QoS documentation\n", v->lineno); ast_log(LOG_WARNING, "Invalid cos_audio value at line %d, refer to QoS documentation\n", v->lineno);
@ -4226,7 +4211,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
autoprovisioning = AUTOPROVISIONING_NO; autoprovisioning = AUTOPROVISIONING_NO;
else if (!strcasecmp(v->value, "yes")) else if (!strcasecmp(v->value, "yes"))
autoprovisioning = AUTOPROVISIONING_YES; autoprovisioning = AUTOPROVISIONING_YES;
@@ -5490,44 +6372,57 @@ static int reload_config(void) @@ -5489,44 +6371,57 @@ static int reload_config(void)
d = devices; d = devices;
while (d) { while (d) {
if (d->to_delete) { if (d->to_delete) {
@ -4315,7 +4300,7 @@ $OpenBSD: patch-channels_chan_unistim_c,v 1.2 2011/06/24 13:50:09 sthen Exp $
if (d->session) { if (d->session) {
if (sessions == d->session) if (sessions == d->session)
sessions = d->session->next; sessions = d->session->next;
@@ -5571,9 +6466,15 @@ static int reload_config(void) @@ -5570,9 +6465,15 @@ static int reload_config(void)
ast_mutex_lock(&sessionlock); ast_mutex_lock(&sessionlock);
s = sessions; s = sessions;
while (s) { while (s) {

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-configure_ac,v 1.15 2011/03/02 13:28:24 sthen Exp $ $OpenBSD: patch-configure_ac,v 1.16 2011/07/12 19:54:39 sthen Exp $
--- configure.ac.orig Sun Jan 9 21:40:34 2011 --- configure.ac.orig Mon May 23 17:19:32 2011
+++ configure.ac Wed Mar 2 13:00:15 2011 +++ configure.ac Mon Jul 11 23:45:36 2011
@@ -55,7 +55,7 @@ AC_SUBST([astvarrundir], ['${localstatedir}/run/a @@ -55,7 +55,7 @@ AC_SUBST([astvarrundir], ['${localstatedir}/run/a
case "${host_os}" in case "${host_os}" in
@ -10,7 +10,7 @@ $OpenBSD: patch-configure_ac,v 1.15 2011/03/02 13:28:24 sthen Exp $
astvarlibdir='${prefix}/share/asterisk' astvarlibdir='${prefix}/share/asterisk'
astdbdir='${localstatedir}/db/asterisk' astdbdir='${localstatedir}/db/asterisk'
fi fi
@@ -1512,7 +1512,7 @@ if test "${USE_IMAP_TK}" != "no"; then @@ -1514,7 +1514,7 @@ if test "${USE_IMAP_TK}" != "no"; then
) )
else #looking in imap directory didn't work, try c-client else #looking in imap directory didn't work, try c-client
imap_ldflags="" imap_ldflags=""
@ -19,7 +19,7 @@ $OpenBSD: patch-configure_ac,v 1.15 2011/03/02 13:28:24 sthen Exp $
imap_include="-DUSE_SYSTEM_CCLIENT" imap_include="-DUSE_SYSTEM_CCLIENT"
CPPFLAGS="${saved_cppflags}" CPPFLAGS="${saved_cppflags}"
LIBS="${saved_libs}" LIBS="${saved_libs}"
@@ -1722,7 +1722,7 @@ AST_EXT_TOOL_CHECK([NETSNMP], [net-snmp-config], , [-- @@ -1724,7 +1724,7 @@ AST_EXT_TOOL_CHECK([NETSNMP], [net-snmp-config], , [--
AST_EXT_LIB_CHECK([NEWT], [newt], [newtBell], [newt.h]) AST_EXT_LIB_CHECK([NEWT], [newt], [newtBell], [newt.h])
@ -28,7 +28,7 @@ $OpenBSD: patch-configure_ac,v 1.15 2011/03/02 13:28:24 sthen Exp $
AST_EXT_LIB_CHECK([OGG], [ogg], [ogg_sync_init], []) AST_EXT_LIB_CHECK([OGG], [ogg], [ogg_sync_init], [])
@@ -1874,7 +1874,8 @@ if test "${PBX_PWLIB}" = "1" -a "${USE_OPENH323}" != " @@ -1876,7 +1876,8 @@ if test "${PBX_PWLIB}" = "1" -a "${USE_OPENH323}" != "
AST_CHECK_OPENH323() AST_CHECK_OPENH323()
AST_CHECK_PWLIB_VERSION([OpenH323], [OPENH323], [openh323buildopts.h], [1], [17], [3], [], [1], [19], [0]) AST_CHECK_PWLIB_VERSION([OpenH323], [OPENH323], [openh323buildopts.h], [1], [17], [3], [], [1], [19], [0])
AST_CHECK_OPENH323_BUILD() AST_CHECK_OPENH323_BUILD()
@ -38,7 +38,7 @@ $OpenBSD: patch-configure_ac,v 1.15 2011/03/02 13:28:24 sthen Exp $
AST_CHECK_PWLIB_BUILD([OpenH323], [OPENH323], AST_CHECK_PWLIB_BUILD([OpenH323], [OPENH323],
[Define if your system has the OpenH323 libraries.], [Define if your system has the OpenH323 libraries.],
[#include "ptlib.h" [#include "ptlib.h"
@@ -2029,7 +2030,8 @@ AST_EXT_LIB_CHECK([USB], [usb], [usb_init], [usb.h], [ @@ -2030,7 +2031,8 @@ AST_EXT_LIB_CHECK([USB], [usb], [usb_init], [usb.h], [
if test "${OSARCH}" = "OpenBSD"; if test "${OSARCH}" = "OpenBSD";
then then

View File

@ -1,10 +1,10 @@
$OpenBSD: patch-contrib_scripts_safe_asterisk,v 1.12 2010/06/07 20:03:55 sthen Exp $ $OpenBSD: patch-contrib_scripts_safe_asterisk,v 1.13 2011/07/12 19:54:39 sthen Exp $
- more useful defaults - more useful defaults
- create /var/run/asterisk with sane ownership/perms - create /var/run/asterisk with sane ownership/perms
--- contrib/scripts/safe_asterisk.orig Tue Jan 12 03:25:20 2010 --- contrib/scripts/safe_asterisk.orig Thu May 5 16:04:24 2011
+++ contrib/scripts/safe_asterisk Mon Jun 7 17:32:16 2010 +++ contrib/scripts/safe_asterisk Mon Jul 11 23:45:36 2011
@@ -2,9 +2,9 @@ @@ -2,9 +2,9 @@
# vim:textwidth=80:tabstop=4:shiftwidth=4:smartindent:autoindent # vim:textwidth=80:tabstop=4:shiftwidth=4:smartindent:autoindent
@ -51,7 +51,7 @@ $OpenBSD: patch-contrib_scripts_safe_asterisk,v 1.12 2010/06/07 20:03:55 sthen E
+ +
# Check if Asterisk is already running. If it is, then bug out, because # Check if Asterisk is already running. If it is, then bug out, because
# starting safe_asterisk when Asterisk is running is very bad. # starting safe_asterisk when Asterisk is running is very bad.
VERSION=`${ASTSBINDIR}/asterisk -rx 'core show version'` VERSION=`${ASTSBINDIR}/asterisk -nrx 'core show version'`
@@ -71,7 +85,7 @@ else @@ -71,7 +85,7 @@ else
fi fi
fi fi

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-main_asterisk_c,v 1.18 2011/01/19 11:25:16 sthen Exp $ $OpenBSD: patch-main_asterisk_c,v 1.19 2011/07/12 19:54:39 sthen Exp $
--- main/asterisk.c.orig Thu Nov 11 19:42:06 2010 --- main/asterisk.c.orig Mon Jun 27 17:30:50 2011
+++ main/asterisk.c Mon Dec 13 20:33:41 2010 +++ main/asterisk.c Mon Jul 11 23:45:36 2011
@@ -1186,7 +1186,7 @@ static pthread_t lthread; @@ -1192,7 +1192,7 @@ static pthread_t lthread;
static int read_credentials(int fd, char *buffer, size_t size, struct console *con) static int read_credentials(int fd, char *buffer, size_t size, struct console *con)
{ {
#if defined(SO_PEERCRED) #if defined(SO_PEERCRED)

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-sounds_Makefile,v 1.7 2011/03/02 13:28:24 sthen Exp $ $OpenBSD: patch-sounds_Makefile,v 1.8 2011/07/12 19:54:39 sthen Exp $
--- sounds/Makefile.orig Wed Dec 29 19:28:36 2010 --- sounds/Makefile.orig Wed Apr 27 13:36:17 2011
+++ sounds/Makefile Wed Mar 2 13:00:16 2011 +++ sounds/Makefile Mon Jul 11 23:45:36 2011
@@ -150,6 +150,8 @@ prefixcmd: @@ -151,6 +151,8 @@ prefixcmd:
@$(PREFIXCMD) @$(PREFIXCMD)
have_download: have_download:

View File

@ -1,4 +1,4 @@
@comment $OpenBSD: PLIST-main,v 1.37 2011/05/11 15:07:15 sthen Exp $ @comment $OpenBSD: PLIST-main,v 1.38 2011/07/12 19:54:39 sthen Exp $
@conflict asterisk-sounds-<=1.2.1p2 @conflict asterisk-sounds-<=1.2.1p2
@conflict asterisk-curl-* @conflict asterisk-curl-*
@conflict asterisk-fax-* @conflict asterisk-fax-*
@ -291,6 +291,7 @@ lib/asterisk/modules/func_extstate.so
lib/asterisk/modules/func_frame_trace.so lib/asterisk/modules/func_frame_trace.so
lib/asterisk/modules/func_global.so lib/asterisk/modules/func_global.so
lib/asterisk/modules/func_groupcount.so lib/asterisk/modules/func_groupcount.so
lib/asterisk/modules/func_iconv.so
lib/asterisk/modules/func_lock.so lib/asterisk/modules/func_lock.so
lib/asterisk/modules/func_logic.so lib/asterisk/modules/func_logic.so
lib/asterisk/modules/func_math.so lib/asterisk/modules/func_math.so
@ -433,6 +434,8 @@ share/asterisk/sounds/en/conf-usermenu.gsm
share/asterisk/sounds/en/conf-userswilljoin.gsm share/asterisk/sounds/en/conf-userswilljoin.gsm
share/asterisk/sounds/en/conf-userwilljoin.gsm share/asterisk/sounds/en/conf-userwilljoin.gsm
share/asterisk/sounds/en/conf-waitforleader.gsm share/asterisk/sounds/en/conf-waitforleader.gsm
share/asterisk/sounds/en/confbridge-join.gsm
share/asterisk/sounds/en/confbridge-leave.gsm
share/asterisk/sounds/en/core-sounds-en.txt share/asterisk/sounds/en/core-sounds-en.txt
share/asterisk/sounds/en/demo-abouttotry.gsm share/asterisk/sounds/en/demo-abouttotry.gsm
share/asterisk/sounds/en/demo-congrats.gsm share/asterisk/sounds/en/demo-congrats.gsm
@ -847,6 +850,7 @@ share/asterisk/sounds/en/vm-youhave.gsm
share/asterisk/sounds/en_AU/ share/asterisk/sounds/en_AU/
share/asterisk/sounds/es/ share/asterisk/sounds/es/
share/asterisk/sounds/fr/ share/asterisk/sounds/fr/
share/asterisk/sounds/ru/
share/asterisk/static-http/ share/asterisk/static-http/
share/asterisk/static-http/ajamdemo.html share/asterisk/static-http/ajamdemo.html
share/asterisk/static-http/astman.css share/asterisk/static-http/astman.css