diff options
Diffstat (limited to 'net/asterisk-oh323/files/patch-asterisk-driver::chan_oh323.c')
-rw-r--r-- | net/asterisk-oh323/files/patch-asterisk-driver::chan_oh323.c | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/net/asterisk-oh323/files/patch-asterisk-driver::chan_oh323.c b/net/asterisk-oh323/files/patch-asterisk-driver::chan_oh323.c index 23365438567f..84eca9aa9292 100644 --- a/net/asterisk-oh323/files/patch-asterisk-driver::chan_oh323.c +++ b/net/asterisk-oh323/files/patch-asterisk-driver::chan_oh323.c @@ -1,8 +1,5 @@ - -$FreeBSD$ - --- asterisk-driver/chan_oh323.c.orig Tue Sep 20 13:50:34 2005 -+++ asterisk-driver/chan_oh323.c Wed Jan 25 17:59:14 2006 ++++ asterisk-driver/chan_oh323.c Wed Apr 19 16:06:11 2006 @@ -43,10 +43,12 @@ #include <sys/types.h> #include <sys/stat.h> @@ -26,32 +23,33 @@ $FreeBSD$ static int oh323_text(struct ast_channel *c, const char *text); static int oh323_call(struct ast_channel *c, char *dest, int timeout); static int oh323_hangup(struct ast_channel *c); -@@ -2402,11 +2404,11 @@ static int oh323_write(struct ast_channe +@@ -2402,11 +2404,12 @@ static int oh323_write(struct ast_channe } /* Check for format changes */ - if (f->subclass != i->owner->nativeformats) { -+ if (!f->subclass & i->owner->nativeformats.bits) { ++ if (!f->subclass & ast_codec_pref_bits(&i->owner->nativeformats)) { ++ char tmp[512]; ast_log(LOG_NOTICE, "%s: Format changed to %s (native %s).\n", c->name, ast_getformatname(f->subclass), - ast_getformatname(c->nativeformats)); -+ ast_getformatname(c->nativeformats.bits)); ++ ast_codec_pref_dump(tmp, sizeof(tmp), &c->nativeformats)); if (ast_set_write_format(c, f->subclass) < 0) { ast_mutex_unlock(&oh323_tab_lock); return(-1); -@@ -2802,8 +2804,8 @@ static struct ast_channel *ast_oh323_new +@@ -2802,8 +2805,8 @@ static struct ast_channel *ast_oh323_new /* Set our native format */ /* XXX: Only one should be selected */ - tmp->nativeformats = oh323_capability; - fmt = oh323_codec_choose(tmp->nativeformats); + ast_codec_pref_append_missing2(&tmp->nativeformats, oh323_capability); -+ fmt = oh323_codec_choose(tmp->nativeformats.bits); ++ fmt = oh323_codec_choose(ast_codec_pref_bits(&tmp->nativeformats)); /*fmt = ast_best_codec(tmp->nativeformats);*/ tmp->writeformat = fmt; -@@ -2927,23 +2929,15 @@ static struct ast_channel *ast_oh323_new +@@ -2927,23 +2930,15 @@ static struct ast_channel *ast_oh323_new * This function limits the number of outbound H.323 calls. * Return NULL on error, the pointer to the channel on success. */ @@ -74,28 +72,32 @@ $FreeBSD$ - ast_log(LOG_ERROR, "Asked to get a channel of unsupported format '%d'\n", format); - return NULL; - } -+ type, formats->bits, (char *)data); ++ type, ast_codec_pref_bits(formats), (char *)data); ast_mutex_lock(&oh323_tab_lock); -@@ -3003,12 +2997,12 @@ static struct ast_channel *oh323_request +@@ -3003,13 +2998,14 @@ static struct ast_channel *oh323_request oh323_tab[i]->owner = c; /* Specify our native formats */ - c->nativeformats = format; - c->rawwriteformat = format; - c->rawreadformat = format; +- if (option_debug) + memcpy(&c->nativeformats, formats, sizeof(struct ast_codec_pref)); -+ c->rawwriteformat = formats->bits; -+ c->rawreadformat = formats->bits; - if (option_debug) ++ c->rawwriteformat = ast_codec_pref_bits(formats); ++ c->rawreadformat = ast_codec_pref_bits(formats); ++ if (option_debug) { ++ char tmp[512]; ast_log(LOG_DEBUG, "%s: Native format changed to %s.\n", - c->name, ast_getformatname(format)); -+ c->name, ast_getformatname(formats->bits)); - +- ++ c->name, ast_codec_pref_dump(tmp, sizeof(tmp), formats)); ++ } ast_mutex_unlock(&oh323_tab_lock); return c; -@@ -3439,7 +3433,8 @@ char *setup_h323_connection(call_details + } +@@ -3439,7 +3435,8 @@ char *setup_h323_connection(call_details ast_log(LOG_DEBUG, "Setting channel '%s' native format to %s!\n", oh323_tab[i]->owner->name, ast_getformatname(oh323_tab[i]->capability)); @@ -105,7 +107,7 @@ $FreeBSD$ } /* Set environment variables */ -@@ -3512,7 +3507,8 @@ char *setup_h323_connection(call_details +@@ -3512,7 +3509,8 @@ char *setup_h323_connection(call_details ast_log(LOG_DEBUG, "Setting channel '%s' native format to %s!\n", oh323_tab[i]->owner->name, ast_getformatname(oh323_tab[i]->capability)); @@ -115,7 +117,7 @@ $FreeBSD$ if (oh323_tab[i]->tx_smooth) { ast_smoother_free(oh323_tab[i]->tx_smooth); oh323_tab[i]->tx_smooth = NULL; -@@ -4429,7 +4425,7 @@ static int kill_monitor(void) +@@ -4429,7 +4427,7 @@ static int kill_monitor(void) return(-1); } } |