aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjeremy <jeremy@f38db490-d61c-443f-a65b-d21fe96a405b>2004-12-16 02:03:19 +0000
committerjeremy <jeremy@f38db490-d61c-443f-a65b-d21fe96a405b>2004-12-16 02:03:19 +0000
commitc704778e2b97cac971e6c1041256c4561130ffde (patch)
treeade1d109249d2c2274261d9b1f5175b7425b1bd8
parentd405f48268f1722f7b52ae79007b817b5b4e6835 (diff)
Properly deal with Caller*ID, document the new RTP Payload setting, remove compiler option that may confuse g++ and force chan_h323.so to be relinked on every compile
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4467 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-xchannels/chan_h323.c16
-rwxr-xr-xchannels/h323/Makefile5
-rwxr-xr-xchannels/h323/ast_h323.cpp26
-rwxr-xr-xchannels/h323/ast_h323.h3
-rwxr-xr-xchannels/h323/chan_h323.h4
-rwxr-xr-xchannels/h323/h323.conf.sample7
6 files changed, 44 insertions, 17 deletions
diff --git a/channels/chan_h323.c b/channels/chan_h323.c
index a3a22e8c7..a8404682a 100755
--- a/channels/chan_h323.c
+++ b/channels/chan_h323.c
@@ -131,9 +131,9 @@ struct oh323_pvt {
char exten[AST_MAX_EXTENSION]; /* Requested extension */
char context[AST_MAX_EXTENSION]; /* Context where to start */
char accountcode[256]; /* Account code */
- char cid_num[256]; /* Caller*id number, if available */
- char cid_name[256]; /* Caller*id name, if available */
- char rdnis[256]; /* Referring DNIS, if available */
+ char cid_num[80]; /* Caller*id number, if available */
+ char cid_name[80]; /* Caller*id name, if available */
+ char rdnis[80]; /* Referring DNIS, if available */
int amaflags; /* AMA Flags */
struct ast_rtp *rtp; /* RTP Session */
int dtmfmode; /* What DTMF Mode is being used */
@@ -499,7 +499,15 @@ static int oh323_call(struct ast_channel *c, char *dest, int timeout)
} else {
ast_inet_ntoa(addr, sizeof(addr), pvt->sa.sin_addr);
pvt->options.port = htons(pvt->sa.sin_port);
- }
+ }
+
+ if (c->cid.cid_num) {
+ strncpy(pvt->options.cid_num, c->cid.cid_num, sizeof(pvt->options.cid_num));
+ }
+ if (c->cid.cid_name) {
+ strncpy(pvt->options.cid_name, c->cid.cid_name, sizeof(pvt->options.cid_name));
+ }
+
/* indicate that this is an outgoing call */
pvt->outgoing = 1;
diff --git a/channels/h323/Makefile b/channels/h323/Makefile
index 1c6f1f4e4..97293d24f 100755
--- a/channels/h323/Makefile
+++ b/channels/h323/Makefile
@@ -37,11 +37,11 @@ endif
#
OSARCH=$(shell uname -s)
CFLAGS += -DNDEBUG -DDO_CRASH -DDEBUG_THREADS
-CFLAGS += -pipe -Wall -fPIC -Wmissing-prototypes -Wmissing-declarations
+CFLAGS += -pipe -Wall -fPIC -Wmissing-prototypes
CFLAGS += -D_REENTRANT -D_GNU_SOURCE
CFLAGS += -I../../include
CFLAGS += -I$(PWLIBDIR)/include
-CFLAGS += -I$(OPENH323DIR)/include -Wno-missing-prototypes -Wno-missing-declarations
+CFLAGS += -I$(OPENH323DIR)/include -Wno-missing-prototypes
all: depend libchanh323.a
@@ -54,6 +54,7 @@ samples:
libchanh323.a: ast_h323.o
ar cr libchanh323.a ast_h323.o
+ touch ../chan_h323.c
ast_h323.o: ast_h323.cpp
$(CXX) -g -c -o $@ $(CFLAGS) $<
diff --git a/channels/h323/ast_h323.cpp b/channels/h323/ast_h323.cpp
index 616b7381b..fc77e9b85 100755
--- a/channels/h323/ast_h323.cpp
+++ b/channels/h323/ast_h323.cpp
@@ -237,16 +237,15 @@ int MyH323EndPoint::MakeCall(const PString & dest, PString & token, unsigned int
return 1;
}
*callReference = connection->GetCallReference();
+
+ if (opts->cid_num) {
+ connection->ast_cid_num = PString(opts->cid_num);
+ }
if (opts->cid_name) {
- localAliasNames.RemoveAll();
- connection->SetLocalPartyName(PString(opts->cid_name));
- if (opts->cid_num) {
- localAliasNames.AppendString(PString(opts->cid_num));
- }
- } else if (opts->cid_num) {
- localAliasNames.RemoveAll();
- connection->SetLocalPartyName(PString(opts->cid_num));
- }
+ connection->ast_cid_name = PString(opts->cid_name);
+ connection->SetLocalPartyName(connection->ast_cid_name);
+ }
+
connection->dtmfCodec = (RTP_DataFrame::PayloadTypes)opts->dtmfcodec;
if (h323debug) {
@@ -700,6 +699,15 @@ BOOL MyH323Connection::OnSendSignalSetup(H323SignalPDU & setupPDU)
if (h323debug) {
cout << " -- Sending SETUP message" << endl;
}
+
+ if (!ast_cid_num.IsEmpty()) {
+ setupPDU.GetQ931().SetCallingPartyNumber(ast_cid_num);
+ }
+
+ if (!ast_cid_name.IsEmpty()) {
+ setupPDU.GetQ931().SetDisplayName(ast_cid_name);
+ }
+
sourceAliases = setupPDU.GetSourceAliases();
destAliases = setupPDU.GetDestinationAlias();
diff --git a/channels/h323/ast_h323.h b/channels/h323/ast_h323.h
index 906acd65d..eb8de1874 100755
--- a/channels/h323/ast_h323.h
+++ b/channels/h323/ast_h323.h
@@ -188,6 +188,9 @@ class MyH323Connection : public H323Connection {
unsigned progressAlert;
RTP_DataFrame::PayloadTypes dtmfCodec;
+
+ PString ast_cid_num;
+ PString ast_cid_name;
};
class MyH323_ExternalRTPChannel : public H323_ExternalRTPChannel {
diff --git a/channels/h323/chan_h323.h b/channels/h323/chan_h323.h
index 995b81896..fca116ea9 100755
--- a/channels/h323/chan_h323.h
+++ b/channels/h323/chan_h323.h
@@ -31,8 +31,8 @@
/** call_option struct holds various bits
* of information for each call */
typedef struct call_options {
- char *cid_num;
- char *cid_name;
+ char cid_num[80];
+ char cid_name[80];
int noFastStart;
int noH245Tunneling;
int noSilenceSuppression;
diff --git a/channels/h323/h323.conf.sample b/channels/h323/h323.conf.sample
index a71beebcb..f6f31677c 100755
--- a/channels/h323/h323.conf.sample
+++ b/channels/h323/h323.conf.sample
@@ -31,6 +31,13 @@ allow=gsm ; Always allow GSM, it's cool :)
; default is rfc2833
;dtmfmode=rfc2833
;
+; Default RTP Payload to send RFC2833 DTMF on. This is used to
+; interoperate with broken gateways which cannot successfully
+; negotiate a RFC2833 payload type in the TerminalCapabilitySet.
+;
+; You may also specify on either a per-peer or per-user basis below.
+;dtmfcodec=101
+;
; Set the gatekeeper
; DISCOVER - Find the Gk address using multicast
; DISABLE - Disable the use of a GK