Prefer ast_set_qos() over ast_netsock_set_qos()
[asterisk/asterisk.git] / channels / chan_mgcp.c
index b73ccd2..9a49d00 100644 (file)
@@ -69,7 +69,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #include "asterisk/app.h"
 #include "asterisk/musiconhold.h"
 #include "asterisk/utils.h"
-#include "asterisk/netsock.h"
+#include "asterisk/netsock2.h"
 #include "asterisk/causes.h"
 #include "asterisk/dsp.h"
 #include "asterisk/devicestate.h"
@@ -1212,8 +1212,8 @@ static struct ast_frame *mgcp_rtp_read(struct mgcp_subchannel *sub)
                        if (!ast_format_cap_iscompatible(ast_channel_nativeformats(sub->owner), &f->subclass.format)) {
                                ast_debug(1, "Oooh, format changed to %s\n", ast_getformatname(&f->subclass.format));
                                ast_format_cap_set(ast_channel_nativeformats(sub->owner), &f->subclass.format);
-                               ast_set_read_format(sub->owner, &sub->owner->readformat);
-                               ast_set_write_format(sub->owner, &sub->owner->writeformat);
+                               ast_set_read_format(sub->owner, ast_channel_readformat(sub->owner));
+                               ast_set_write_format(sub->owner, ast_channel_writeformat(sub->owner));
                        }
                        /* Courtesy fearnor aka alex@pilosoft.com */
                        if ((sub->parent->dtmfmode & MGCP_DTMF_INBAND) && (sub->parent->dsp)) {
@@ -1256,8 +1256,8 @@ static int mgcp_write(struct ast_channel *ast, struct ast_frame *frame)
                        ast_log(LOG_WARNING, "Asked to transmit frame type %s, while native formats is %s (read/write = %s/%s)\n",
                                ast_getformatname(&frame->subclass.format),
                                ast_getformatname_multiple(buf, sizeof(buf), ast_channel_nativeformats(ast)),
-                               ast_getformatname(&ast->readformat),
-                               ast_getformatname(&ast->writeformat));
+                               ast_getformatname(ast_channel_readformat(ast)),
+                               ast_getformatname(ast_channel_writeformat(ast)));
                        /* return -1; */
                }
        }
@@ -1518,10 +1518,10 @@ static struct ast_channel *mgcp_new(struct mgcp_subchannel *sub, int state, cons
                        ast_channel_rings_set(tmp, 1);
 
                ast_best_codec(ast_channel_nativeformats(tmp), &tmpfmt);
-               ast_format_copy(&tmp->writeformat, &tmpfmt);
-               ast_format_copy(&tmp->rawwriteformat, &tmpfmt);
-               ast_format_copy(&tmp->readformat, &tmpfmt);
-               ast_format_copy(&tmp->rawreadformat, &tmpfmt);
+               ast_format_copy(ast_channel_writeformat(tmp), &tmpfmt);
+               ast_format_copy(ast_channel_rawwriteformat(tmp), &tmpfmt);
+               ast_format_copy(ast_channel_readformat(tmp), &tmpfmt);
+               ast_format_copy(ast_channel_rawreadformat(tmp), &tmpfmt);
                ast_channel_tech_pvt_set(tmp, sub);
                if (!ast_strlen_zero(i->language))
                        ast_channel_language_set(tmp, i->language);
@@ -4775,7 +4775,7 @@ static int reload_config(int reload)
                } else {
                        ast_verb(2, "MGCP Listening on %s:%d\n",
                                        ast_inet_ntoa(bindaddr.sin_addr), ntohs(bindaddr.sin_port));
-                       ast_netsock_set_qos(mgcpsock, qos.tos, qos.cos, "MGCP");
+                       ast_set_qos(mgcpsock, qos.tos, qos.cos, "MGCP");
                }
        }
        ast_mutex_unlock(&netlock);