Add fixup to chan_phone (bug #3825)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5304 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
parent
02b007bf35
commit
47c004373a
|
@ -140,6 +140,7 @@ static struct ast_frame *phone_read(struct ast_channel *ast);
|
||||||
static int phone_write(struct ast_channel *ast, struct ast_frame *frame);
|
static int phone_write(struct ast_channel *ast, struct ast_frame *frame);
|
||||||
static struct ast_frame *phone_exception(struct ast_channel *ast);
|
static struct ast_frame *phone_exception(struct ast_channel *ast);
|
||||||
static int phone_send_text(struct ast_channel *ast, const char *text);
|
static int phone_send_text(struct ast_channel *ast, const char *text);
|
||||||
|
static int phone_fixup(struct ast_channel *old, struct ast_channel *new);
|
||||||
|
|
||||||
static const struct ast_channel_tech phone_tech = {
|
static const struct ast_channel_tech phone_tech = {
|
||||||
.type = type,
|
.type = type,
|
||||||
|
@ -153,6 +154,7 @@ static const struct ast_channel_tech phone_tech = {
|
||||||
.read = phone_read,
|
.read = phone_read,
|
||||||
.write = phone_write,
|
.write = phone_write,
|
||||||
.exception = phone_exception,
|
.exception = phone_exception,
|
||||||
|
.fixup = phone_fixup
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct ast_channel_tech phone_tech_fxs = {
|
static struct ast_channel_tech phone_tech_fxs = {
|
||||||
|
@ -168,10 +170,19 @@ static struct ast_channel_tech phone_tech_fxs = {
|
||||||
.exception = phone_exception,
|
.exception = phone_exception,
|
||||||
.write_video = phone_write,
|
.write_video = phone_write,
|
||||||
.send_text = phone_send_text,
|
.send_text = phone_send_text,
|
||||||
|
.fixup = phone_fixup
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct ast_channel_tech *cur_tech;
|
static struct ast_channel_tech *cur_tech;
|
||||||
|
|
||||||
|
static int phone_fixup(struct ast_channel *old, struct ast_channel *new)
|
||||||
|
{
|
||||||
|
struct phone_pvt *pvt = old->tech_pvt;
|
||||||
|
if (pvt && pvt->owner == old)
|
||||||
|
pvt->owner = new;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int phone_digit(struct ast_channel *ast, char digit)
|
static int phone_digit(struct ast_channel *ast, char digit)
|
||||||
{
|
{
|
||||||
struct phone_pvt *p;
|
struct phone_pvt *p;
|
||||||
|
|
Reference in New Issue