[asterisk-commits] jpeeler: branch jpeeler/feature14882 r281083 - in /team/jpeeler/feature14882:...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Aug 5 13:23:06 CDT 2010
Author: jpeeler
Date: Thu Aug 5 13:23:00 2010
New Revision: 281083
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=281083
Log:
finish necessary API changes
Modified:
team/jpeeler/feature14882/channels/chan_iax2.c
team/jpeeler/feature14882/channels/chan_sip.c
team/jpeeler/feature14882/channels/sip/include/sip.h
team/jpeeler/feature14882/include/asterisk/features.h
team/jpeeler/feature14882/main/features.c
Modified: team/jpeeler/feature14882/channels/chan_iax2.c
URL: http://svnview.digium.com/svn/asterisk/team/jpeeler/feature14882/channels/chan_iax2.c?view=diff&rev=281083&r1=281082&r2=281083
==============================================================================
--- team/jpeeler/feature14882/channels/chan_iax2.c (original)
+++ team/jpeeler/feature14882/channels/chan_iax2.c Thu Aug 5 13:23:00 2010
@@ -9105,6 +9105,7 @@
struct iax_dual {
struct ast_channel *chan1;
struct ast_channel *chan2;
+ const char *parkexten;
};
static void *iax_park_thread(void *stuff)
@@ -9121,13 +9122,13 @@
f = ast_read(chan1);
if (f)
ast_frfree(f);
- res = ast_park_call(chan1, chan2, 0, &ext);
+ res = ast_park_call(chan1, chan2, 0, d->parkexten, &ext);
ast_hangup(chan2);
ast_log(LOG_NOTICE, "Parked on extension '%d'\n", ext);
return NULL;
}
-static int iax_park(struct ast_channel *chan1, struct ast_channel *chan2)
+static int iax_park(struct ast_channel *chan1, struct ast_channel *chan2, const char *parkexten)
{
struct iax_dual *d;
struct ast_channel *chan1m, *chan2m;
@@ -9169,6 +9170,7 @@
if ((d = ast_calloc(1, sizeof(*d)))) {
d->chan1 = chan1m;
d->chan2 = chan2m;
+ d->parkexten = parkexten;
if (!ast_pthread_create_detached_background(&th, NULL, iax_park_thread, d)) {
return 0;
}
@@ -10544,7 +10546,7 @@
if (ast_parking_ext_valid(ies.called_number)) {
struct ast_channel *saved_channel = iaxs[fr->callno]->owner;
ast_mutex_unlock(&iaxsl[fr->callno]);
- if (iax_park(bridged_chan, saved_channel)) {
+ if (iax_park(bridged_chan, saved_channel, ies.called_number)) {
ast_log(LOG_WARNING, "Failed to park call on '%s'\n", bridged_chan->name);
} else {
ast_debug(1, "Parked call on '%s'\n", ast_bridged_channel(iaxs[fr->callno]->owner)->name);
Modified: team/jpeeler/feature14882/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/jpeeler/feature14882/channels/chan_sip.c?view=diff&rev=281083&r1=281082&r2=281083
==============================================================================
--- team/jpeeler/feature14882/channels/chan_sip.c (original)
+++ team/jpeeler/feature14882/channels/chan_sip.c Thu Aug 5 13:23:00 2010
@@ -1261,7 +1261,7 @@
static struct sip_pvt *get_sip_pvt_byid_locked(const char *callid, const char *totag, const char *fromtag);
static void check_pendings(struct sip_pvt *p);
static void *sip_park_thread(void *stuff);
-static int sip_park(struct ast_channel *chan1, struct ast_channel *chan2, struct sip_request *req, int seqno);
+static int sip_park(struct ast_channel *chan1, struct ast_channel *chan2, struct sip_request *req, int seqno, char *parkexten);
static int sip_sipredirect(struct sip_pvt *p, const char *dest);
static int is_method_allowed(unsigned int *allowed_methods, enum sipmethod method);
@@ -19957,7 +19957,7 @@
return NULL;
}
- res = ast_park_call(transferee, transferer, 0, &ext);
+ res = ast_park_call(transferee, transferer, 0, d->parkexten, &ext);
#ifdef WHEN_WE_KNOW_THAT_THE_CLIENT_SUPPORTS_MESSAGE
@@ -19994,7 +19994,7 @@
/*! \brief Park a call using the subsystem in res_features.c
This is executed in a separate thread
*/
-static int sip_park(struct ast_channel *chan1, struct ast_channel *chan2, struct sip_request *req, int seqno)
+static int sip_park(struct ast_channel *chan1, struct ast_channel *chan2, struct sip_request *req, int seqno, char *parkexten)
{
struct sip_dual *d;
struct ast_channel *transferee, *transferer;
@@ -20075,6 +20075,7 @@
d->chan1 = transferee; /* Transferee */
d->chan2 = transferer; /* Transferer */
d->seqno = seqno;
+ d->parkexten = parkexten;
if (ast_pthread_create_detached_background(&th, NULL, sip_park_thread, d) < 0) {
/* Could not start thread */
deinit_req(&d->req);
@@ -21974,7 +21975,7 @@
p->refer->refer_to);
if (sipdebug)
ast_debug(4, "SIP transfer to parking: trying to park %s. Parked by %s\n", current.chan2->name, current.chan1->name);
- sip_park(current.chan2, current.chan1, req, seqno);
+ sip_park(current.chan2, current.chan1, req, seqno, p->refer->refer_to);
return res;
}
Modified: team/jpeeler/feature14882/channels/sip/include/sip.h
URL: http://svnview.digium.com/svn/asterisk/team/jpeeler/feature14882/channels/sip/include/sip.h?view=diff&rev=281083&r1=281082&r2=281083
==============================================================================
--- team/jpeeler/feature14882/channels/sip/include/sip.h (original)
+++ team/jpeeler/feature14882/channels/sip/include/sip.h Thu Aug 5 13:23:00 2010
@@ -774,6 +774,7 @@
struct ast_channel *chan2; /*!< Second channel involved */
struct sip_request req; /*!< Request that caused the transfer (REFER) */
int seqno; /*!< Sequence number */
+ const char *parkexten;
};
/*! \brief Parameters to the transmit_invite function */
Modified: team/jpeeler/feature14882/include/asterisk/features.h
URL: http://svnview.digium.com/svn/asterisk/team/jpeeler/feature14882/include/asterisk/features.h?view=diff&rev=281083&r1=281082&r2=281083
==============================================================================
--- team/jpeeler/feature14882/include/asterisk/features.h (original)
+++ team/jpeeler/feature14882/include/asterisk/features.h Thu Aug 5 13:23:00 2010
@@ -90,7 +90,7 @@
* \retval 0 on success.
* \retval -1 on failure.
*/
-int ast_park_call(struct ast_channel *chan, struct ast_channel *host, int timeout, int *extout);
+int ast_park_call(struct ast_channel *chan, struct ast_channel *host, int timeout, const char *parkexten, int *extout);
/*!
* \brief Park a call via a masqueraded channel
Modified: team/jpeeler/feature14882/main/features.c
URL: http://svnview.digium.com/svn/asterisk/team/jpeeler/feature14882/main/features.c?view=diff&rev=281083&r1=281082&r2=281083
==============================================================================
--- team/jpeeler/feature14882/main/features.c (original)
+++ team/jpeeler/feature14882/main/features.c Thu Aug 5 13:23:00 2010
@@ -459,7 +459,7 @@
int ast_parking_ext_valid(const char *exten)
{
struct ast_parkinglot *curlot;
- curlot = ao2_callback(parkinglots, 0, find_parkinglot_by_exten_cb, &exten);
+ curlot = ao2_callback(parkinglots, 0, find_parkinglot_by_exten_cb, (void *) exten);
if (curlot) {
ao2_ref(curlot, -1);
return 1;
@@ -708,6 +708,7 @@
const char *orig_chan_name;
const char *return_con;
const char *return_ext;
+ const char *parkexten;
int return_pri;
uint32_t flags;
/*! Parked user that has already obtained a parking space */
@@ -720,6 +721,11 @@
int i, parking_space = -1, parking_range;
const char *parkinglotname = NULL;
const char *parkingexten;
+
+ /* HACK: jpeeler fix this junk */
+ if (args->parkexten) {
+ parkinglot = ao2_callback(parkinglots, 0, find_parkinglot_by_exten_cb, (void *) args->parkexten);
+ }
if (parkinglot) {
parkinglotname = parkinglot->name;
@@ -1023,11 +1029,12 @@
}
/*! \brief Park a call */
-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, const char *parkexten, int *extout)
{
struct ast_park_call_args args = {
.timeout = timeout,
.extout = extout,
+ .parkexten = parkexten,
};
return park_call_full(chan, peer, &args);
More information about the asterisk-commits
mailing list