- Doxygen and some formatting fixes in res_features

- Get rid of compiler warnings in chan_sip


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@35210 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.4
Olle Johansson 20 years ago
parent a85fec94fd
commit 7876a86e96

@ -11969,7 +11969,7 @@ static void *sip_park_thread(void *stuff)
if (!transferee || !transferer) { if (!transferee || !transferer) {
ast_log(LOG_ERROR, "Missing channels for parking! Transferer %s Transferee %s\n", transferer ? "<available>" : "<missing>", transferee ? "<available>" : "<missing>" ); ast_log(LOG_ERROR, "Missing channels for parking! Transferer %s Transferee %s\n", transferer ? "<available>" : "<missing>", transferee ? "<available>" : "<missing>" );
return; return NULL;
} }
if (option_debug > 3) if (option_debug > 3)
ast_log(LOG_DEBUG, "SIP Park: Transferer channel %s, Transferee %s\n", transferer->name, transferee->name); ast_log(LOG_DEBUG, "SIP Park: Transferer channel %s, Transferee %s\n", transferer->name, transferee->name);

@ -125,14 +125,13 @@ static struct ast_app *monitor_app = NULL;
static int monitor_ok = 1; static int monitor_ok = 1;
struct parkeduser { struct parkeduser {
struct ast_channel *chan; struct ast_channel *chan; /*!< Parking channel */
struct timeval start; struct timeval start; /*!< Time the parking started */
int parkingnum; int parkingnum; /*!< Parking lot */
/* Where to go if our parking time expires */ char context[AST_MAX_CONTEXT]; /*!< Where to go if our parking time expires */
char context[AST_MAX_CONTEXT];
char exten[AST_MAX_EXTENSION]; char exten[AST_MAX_EXTENSION];
int priority; int priority;
int parkingtime; int parkingtime; /*!< Maximum length in parking lot before return */
int notquiteyet; int notquiteyet;
char peername[1024]; char peername[1024];
unsigned char moh_trys; unsigned char moh_trys;
@ -265,7 +264,7 @@ static int adsi_announce_park(struct ast_channel *chan, int parkingnum)
} }
/*! \brief Park a call /*! \brief Park a call
We put the user in the parking list, then wake up the parking thread to be sure it looks \note We put the user in the parking list, then wake up the parking thread to be sure it looks
after these channels too */ after these channels too */
int ast_park_call(struct ast_channel *chan, struct ast_channel *peer, int timeout, int *extout) int ast_park_call(struct ast_channel *chan, struct ast_channel *peer, int timeout, int *extout)
{ {
@ -274,9 +273,9 @@ int ast_park_call(struct ast_channel *chan, struct ast_channel *peer, int timeou
char exten[AST_MAX_EXTENSION]; char exten[AST_MAX_EXTENSION];
struct ast_context *con; struct ast_context *con;
if (!(pu = ast_calloc(1, sizeof(*pu)))) { if (!(pu = ast_calloc(1, sizeof(*pu))))
return -1; return -1;
}
ast_mutex_lock(&parking_lock); ast_mutex_lock(&parking_lock);
parking_range = parking_stop - parking_start+1; parking_range = parking_stop - parking_start+1;
for (i = 0; i < parking_range; i++) { for (i = 0; i < parking_range; i++) {
@ -305,7 +304,7 @@ int ast_park_call(struct ast_channel *chan, struct ast_channel *peer, int timeou
pu->chan = chan; pu->chan = chan;
/* Start music on hold */ /* Start music on hold */
if (chan != peer) { if (chan != peer) {
ast_indicate(pu->chan, AST_CONTROL_HOLD); ast_indicate(pu->chan, AST_CONTROL_HOLD); /* Indicate to peer that we're on hold */
ast_moh_start(pu->chan, NULL); ast_moh_start(pu->chan, NULL);
} }
pu->start = ast_tvnow(); pu->start = ast_tvnow();
@ -345,22 +344,21 @@ int ast_park_call(struct ast_channel *chan, struct ast_channel *peer, int timeou
S_OR(pu->chan->cid.cid_name, "<unknown>") S_OR(pu->chan->cid.cid_name, "<unknown>")
); );
if (peer) { if (peer && adsipark && adsi_available(peer)) {
if (adsipark && adsi_available(peer))
adsi_announce_park(peer, pu->parkingnum); adsi_announce_park(peer, pu->parkingnum);
if (adsipark && adsi_available(peer))
adsi_unload_session(peer); adsi_unload_session(peer);
} }
con = ast_context_find(parking_con); con = ast_context_find(parking_con);
if (!con) {
con = ast_context_create(NULL, parking_con, registrar);
if (!con) if (!con)
con = ast_context_create(NULL, parking_con, registrar);
if (!con) /* Still no context? Bad */
ast_log(LOG_ERROR, "Parking context '%s' does not exist and unable to create\n", parking_con); ast_log(LOG_ERROR, "Parking context '%s' does not exist and unable to create\n", parking_con);
} else { /* Add extension to context */
if (con) {
snprintf(exten, sizeof(exten), "%d", x); snprintf(exten, sizeof(exten), "%d", x);
ast_add_extension2(con, 1, exten, 1, NULL, NULL, parkedcall, strdup(exten), FREE, registrar); ast_add_extension2(con, 1, exten, 1, NULL, NULL, parkedcall, strdup(exten), FREE, registrar);
} }
/* Tell the peer channel the number of the parking space */
if (peer) if (peer)
ast_say_digits(peer, pu->parkingnum, "", peer->language); ast_say_digits(peer, pu->parkingnum, "", peer->language);
if (pu->notquiteyet) { if (pu->notquiteyet) {
@ -378,7 +376,10 @@ int ast_masq_park_call(struct ast_channel *rchan, struct ast_channel *peer, int
struct ast_frame *f; struct ast_frame *f;
/* Make a new, fake channel that we'll use to masquerade in the real one */ /* Make a new, fake channel that we'll use to masquerade in the real one */
if ((chan = ast_channel_alloc(0))) { if (!(chan = ast_channel_alloc(0))) {
ast_log(LOG_WARNING, "Unable to create parked channel\n");
return -1;
}
/* Let us keep track of the channel name */ /* Let us keep track of the channel name */
ast_string_field_build(chan, name, "Parked/%s",rchan->name); ast_string_field_build(chan, name, "Parked/%s",rchan->name);
@ -394,11 +395,8 @@ int ast_masq_park_call(struct ast_channel *rchan, struct ast_channel *peer, int
f = ast_read(chan); f = ast_read(chan);
if (f) if (f)
ast_frfree(f); ast_frfree(f);
ast_park_call(chan, peer, timeout, extout); ast_park_call(chan, peer, timeout, extout);
} else {
ast_log(LOG_WARNING, "Unable to create parked channel\n");
return -1;
}
return 0; return 0;
} }

Loading…
Cancel
Save