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
This commit is contained in:
parent
d57ecb2763
commit
657295817c
|
@ -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());
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Reference in New Issue