mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 04:30:28 +00:00
copy over username to create a proper called addr
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4206 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -436,25 +436,32 @@ static int oh323_call(struct ast_channel *c, char *dest, int timeout)
|
||||
{
|
||||
int res = 0;
|
||||
struct oh323_pvt *pvt = (struct oh323_pvt *)c->pvt->pvt;
|
||||
char addr[INET_ADDRSTRLEN];
|
||||
char called_addr[INET_ADDRSTRLEN];
|
||||
|
||||
ast_log(LOG_DEBUG, "Dest is %s\n", dest);
|
||||
|
||||
if ((c->_state != AST_STATE_DOWN) && (c->_state != AST_STATE_RESERVED)) {
|
||||
ast_log(LOG_WARNING, "Line is already in use (%s)\n", c->name);
|
||||
return -1;
|
||||
}
|
||||
/* Clear and then set the address to call */
|
||||
memset(called_addr, 0, sizeof(called_addr));
|
||||
memset(addr, 0, sizeof(addr));
|
||||
if (usingGk) {
|
||||
memcpy(called_addr, dest, strlen(called_addr));
|
||||
memcpy(addr, dest, strlen(addr));
|
||||
pvt->options.noFastStart = noFastStart;
|
||||
pvt->options.noH245Tunneling = noH245Tunneling;
|
||||
pvt->options.noSilenceSuppression = noSilenceSuppression;
|
||||
pvt->options.port = h323_signalling_port;
|
||||
} else {
|
||||
ast_inet_ntoa(called_addr, sizeof(called_addr), pvt->sa.sin_addr);
|
||||
ast_inet_ntoa(addr, sizeof(addr), pvt->sa.sin_addr);
|
||||
pvt->options.port = htons(pvt->sa.sin_port);
|
||||
}
|
||||
/* indicate that this is an outgoing call */
|
||||
if (pvt->username) {
|
||||
sprintf(called_addr, "%s:%s", pvt->username, addr);
|
||||
} else {
|
||||
memcpy(called_addr, addr, strlen(called_addr));
|
||||
}
|
||||
pvt->outgoing = 1;
|
||||
ast_log(LOG_DEBUG, "Placing outgoing call to %s:%d\n", called_addr, pvt->options.port);
|
||||
res = h323_make_call(called_addr, &(pvt->cd), pvt->options);
|
||||
|
Reference in New Issue
Block a user