#define DEFAULT_SDPSESSION "Asterisk PBX" /*!< Default SDP session name, (s=) header unless re-defined in sip.conf */
#define DEFAULT_SDPOWNER "root" /*!< Default SDP username field in (o=) header unless re-defined in sip.conf */
#define DEFAULT_ENGINE "asterisk" /*!< Default RTP engine to use for sessions */
+#define DEFAULT_CAPABILITY (AST_FORMAT_ULAW | AST_FORMAT_ALAW | AST_FORMAT_GSM | AST_FORMAT_H263);
#endif
/*@}*/
char default_context[AST_MAX_CONTEXT];
char default_subscribecontext[AST_MAX_CONTEXT];
struct ast_ha *contact_ha; /*! \brief Global list of addresses dynamic peers are not allowed to use */
+ int capability; /*!< Supported codecs */
};
static struct sip_settings sip_cfg; /*!< SIP configuration data.
static int global_qualify_peers; /*!< Number of peers to poke at a given time */
-/*! \brief Codecs that we support by default: */
-static int global_capability = AST_FORMAT_ULAW | AST_FORMAT_ALAW | AST_FORMAT_GSM | AST_FORMAT_H263;
-
static enum st_mode global_st_mode; /*!< Mode of operation for Session-Timers */
static enum st_refresher global_st_refresher; /*!< Session-Timer refresher */
static int global_min_se; /*!< Lowest threshold for session refresh interval */
video = i->capability & AST_FORMAT_VIDEO_MASK;
text = i->capability & AST_FORMAT_TEXT_MASK;
} else {
- what = global_capability; /* Global codec support */
- video = global_capability & AST_FORMAT_VIDEO_MASK;
- text = global_capability & AST_FORMAT_TEXT_MASK;
+ what = sip_cfg.capability; /* Global codec support */
+ video = sip_cfg.capability & AST_FORMAT_VIDEO_MASK;
+ text = sip_cfg.capability & AST_FORMAT_TEXT_MASK;
}
/* Set the native formats for audio and merge in video */
/* Assign default music on hold class */
ast_string_field_set(p, mohinterpret, default_mohinterpret);
ast_string_field_set(p, mohsuggest, default_mohsuggest);
- p->capability = global_capability;
+ p->capability = sip_cfg.capability;
p->allowtransfer = sip_cfg.allowtransfer;
if ((ast_test_flag(&p->flags[0], SIP_DTMF) == SIP_DTMF_RFC2833) ||
(ast_test_flag(&p->flags[0], SIP_DTMF) == SIP_DTMF_AUTO))
ast_cli(a->fd, "\nGlobal Signalling Settings:\n");
ast_cli(a->fd, "---------------------------\n");
ast_cli(a->fd, " Codecs: ");
- ast_getformatname_multiple(codec_buf, sizeof(codec_buf) -1, global_capability);
+ ast_getformatname_multiple(codec_buf, sizeof(codec_buf) -1, sip_cfg.capability);
ast_cli(a->fd, "%s\n", codec_buf);
ast_cli(a->fd, " Codec Order: ");
print_codec_to_cli(a->fd, &default_prefs);
*/
format &= AST_FORMAT_AUDIO_MASK;
if (!format) {
- ast_log(LOG_NOTICE, "Asked to get a channel of unsupported format %s while capability is %s\n", ast_getformatname(oldformat), ast_getformatname(global_capability));
+ ast_log(LOG_NOTICE, "Asked to get a channel of unsupported format %s while capability is %s\n", ast_getformatname(oldformat), ast_getformatname(sip_cfg.capability));
*cause = AST_CAUSE_BEARERCAPABILITY_NOTAVAIL; /* Can't find codec to connect to host */
return NULL;
}
ast_string_field_set(peer, engine, default_engine);
peer->addr.sin_family = AF_INET;
peer->defaddr.sin_family = AF_INET;
- peer->capability = global_capability;
+ peer->capability = sip_cfg.capability;
peer->maxcallbitrate = default_maxcallbitrate;
peer->rtptimeout = global_rtptimeout;
peer->rtpholdtimeout = global_rtpholdtimeout;
/* Reset channel settings to default before re-configuring */
sip_cfg.allow_external_domains = DEFAULT_ALLOW_EXT_DOM; /* Allow external invites */
sip_cfg.regcontext[0] = '\0';
+ sip_cfg.capability = DEFAULT_CAPABILITY;
sip_cfg.regextenonqualify = DEFAULT_REGEXTENONQUALIFY;
sip_cfg.notifyringing = DEFAULT_NOTIFYRINGING;
sip_cfg.notifycid = DEFAULT_NOTIFYCID;
externrefresh = 10;
}
} else if (!strcasecmp(v->name, "allow")) {
- int error = ast_parse_allow_disallow(&default_prefs, &global_capability, v->value, TRUE);
+ int error = ast_parse_allow_disallow(&default_prefs, &sip_cfg.capability, v->value, TRUE);
if (error)
ast_log(LOG_WARNING, "Codec configuration errors found in line %d : %s = %s\n", v->lineno, v->name, v->value);
} else if (!strcasecmp(v->name, "disallow")) {
- int error = ast_parse_allow_disallow(&default_prefs, &global_capability, v->value, FALSE);
+ int error = ast_parse_allow_disallow(&default_prefs, &sip_cfg.capability, v->value, FALSE);
if (error)
ast_log(LOG_WARNING, "Codec configuration errors found in line %d : %s = %s\n", v->lineno, v->name, v->value);
} else if (!strcasecmp(v->name, "preferred_codec_only")) {