aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authorjeremy <jeremy@f38db490-d61c-443f-a65b-d21fe96a405b>2003-06-03 07:11:52 +0000
committerjeremy <jeremy@f38db490-d61c-443f-a65b-d21fe96a405b>2003-06-03 07:11:52 +0000
commit657295817c06e2bfa83383d4a45a3b394f47a805 (patch)
tree752474294d5d60dfd45c2b8fd307b9cddbcbe826 /channels
parentd57ecb276359869ac0a6f9de97acfed3771432fd (diff)
implement H.323ID specification on the exten line. Ex: H323/user@host.tld/h323id
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1069 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rwxr-xr-xchannels/h323/ast_h323.cpp12
-rwxr-xr-xchannels/h323/chan_h323.c15
-rwxr-xr-xchannels/h323/chan_h323.h2
3 files changed, 23 insertions, 6 deletions
diff --git a/channels/h323/ast_h323.cpp b/channels/h323/ast_h323.cpp
index 970d4b10c..da073d770 100755
--- a/channels/h323/ast_h323.cpp
+++ b/channels/h323/ast_h323.cpp
@@ -873,6 +873,14 @@ int h323_set_alias(struct oh323_alias *alias)
return 0;
}
+
+void h323_set_id(char *id)
+{
+ PString h323id(id);
+ /* EVIL HACK */
+ endPoint->SetLocalUserName(h323id);
+}
+
/** Establish Gatekeeper communiations, if so configured,
* register aliases for the H.323 endpoint to respond to.
*/
@@ -952,9 +960,7 @@ int h323_make_call(char *host, call_details_t *cd, call_options_t call_options)
return 1;
}
- PString dest = PString(host);
-
- cout << "dest: " << dest << endl;
+ PString dest(host);
res = endPoint->MakeCall(dest, token, &cd->call_reference, call_options.port);
memcpy((char *)(cd->call_token), (const unsigned char *)token, token.GetLength());
diff --git a/channels/h323/chan_h323.c b/channels/h323/chan_h323.c
index 68e4ebfae..821b7281a 100755
--- a/channels/h323/chan_h323.c
+++ b/channels/h323/chan_h323.c
@@ -373,7 +373,9 @@ static int oh323_call(struct ast_channel *c, char *dest, int timeout)
int res;
struct oh323_pvt *p = c->pvt->pvt;
char called_addr[256];
+ char *tmp;
+ strtok_r(dest, "/", &(tmp));
ast_log(LOG_DEBUG, "dest=%s, timeout=%d.\n", dest, timeout);
@@ -734,8 +736,10 @@ static struct ast_channel *oh323_request(char *type, int format, void *data)
struct ast_channel *tmpc = NULL;
char *dest = data;
char *ext, *host;
+ char *h323id = NULL;
char tmp[256];
+
ast_log(LOG_DEBUG, "type=%s, format=%d, data=%s.\n", type, format, (char *)data);
oldformat = format;
@@ -746,6 +750,7 @@ static struct ast_channel *oh323_request(char *type, int format, void *data)
}
strncpy(tmp, dest, sizeof(tmp) - 1);
+
host = strchr(tmp, '@');
if (host) {
*host = '\0';
@@ -756,6 +761,13 @@ static struct ast_channel *oh323_request(char *type, int format, void *data)
ext = NULL;
}
+ strtok_r(host, "/", &(h323id));
+
+ if (*h323id) {
+ h323_set_id(h323id);
+ }
+
+
p = oh323_alloc(0);
if (!p) {
@@ -1459,9 +1471,6 @@ int reload_config()
ast_log(LOG_ERROR, "Capabilities failure, this is bad.\n");
return -1;
}
-
- printf("CONTEXT RELOAD: [%s]\n", default_context);
-
ast_destroy(cfg);
return 0;
diff --git a/channels/h323/chan_h323.h b/channels/h323/chan_h323.h
index dd49f2165..6873302f6 100755
--- a/channels/h323/chan_h323.h
+++ b/channels/h323/chan_h323.h
@@ -162,6 +162,8 @@ extern "C" {
int h323_set_alias(struct oh323_alias *);
int h323_set_gk(int, char *, char *);
+ void h323_set_id(char *);
+
/* H323 listener related funcions */
int h323_start_listener(int, struct sockaddr_in);