mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-07-07 07:59:49 +00:00
Task #5695 - Need to have RTP IP input field in mod_media_gateway.conf.xml
This commit is contained in:
parent
4569bbec22
commit
5c3e8955de
@ -129,6 +129,8 @@ switch_status_t megaco_activate_termination(mg_termination_t *term)
|
|||||||
switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, kMEDIATYPE, mg_media_type2str(term->u.rtp.media_type));
|
switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, kMEDIATYPE, mg_media_type2str(term->u.rtp.media_type));
|
||||||
switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, "fax_enable_t38", "true");
|
switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, "fax_enable_t38", "true");
|
||||||
switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, "rtp_execute_on_image", "t38_gateway self nocng");
|
switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, "rtp_execute_on_image", "t38_gateway self nocng");
|
||||||
|
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s local_add[%s]\n",__FUNCTION__, term->u.rtp.local_addr);
|
||||||
} else if (term->type == MG_TERM_TDM) {
|
} else if (term->type == MG_TERM_TDM) {
|
||||||
switch_snprintf(dialstring, sizeof dialstring, "tdm/%s", term->name);
|
switch_snprintf(dialstring, sizeof dialstring, "tdm/%s", term->name);
|
||||||
|
|
||||||
@ -276,7 +278,8 @@ mg_termination_t *megaco_choose_termination(megaco_profile_t *profile, const cha
|
|||||||
|
|
||||||
if (termtype == MG_TERM_RTP) {
|
if (termtype == MG_TERM_RTP) {
|
||||||
/* Fill in local address and reserve an rtp port */
|
/* Fill in local address and reserve an rtp port */
|
||||||
term->u.rtp.local_addr = profile->my_ipaddr;
|
//term->u.rtp.local_addr = profile->my_ipaddr;
|
||||||
|
term->u.rtp.local_addr = profile->rtp_ipaddr;
|
||||||
term->u.rtp.local_port = switch_rtp_request_port(term->u.rtp.local_addr);
|
term->u.rtp.local_port = switch_rtp_request_port(term->u.rtp.local_addr);
|
||||||
term->u.rtp.codec = megaco_codec_str(profile->default_codec);
|
term->u.rtp.codec = megaco_codec_str(profile->default_codec);
|
||||||
term->u.rtp.term_id = term_id;
|
term->u.rtp.term_id = term_id;
|
||||||
|
@ -64,6 +64,14 @@ switch_status_t config_profile(megaco_profile_t *profile, switch_bool_t reload)
|
|||||||
profile->total_peers++;
|
profile->total_peers++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If RTP-IP is not defined then default to local-ip */
|
||||||
|
if((!profile->rtp_ipaddr) ||
|
||||||
|
(profile->rtp_ipaddr && ('\0' == profile->rtp_ipaddr[0]))){
|
||||||
|
profile->rtp_ipaddr = switch_mprintf("%s", profile->my_ipaddr);
|
||||||
|
}
|
||||||
|
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,"rtp_ipaddr[%s], local ip[%s]\n", profile->rtp_ipaddr, profile->my_ipaddr);
|
||||||
|
|
||||||
if(SWITCH_STATUS_FALSE == (status = modify_mg_profile_mid(profile, &profile->mid))){
|
if(SWITCH_STATUS_FALSE == (status = modify_mg_profile_mid(profile, &profile->mid))){
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
@ -169,6 +177,7 @@ else
|
|||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* go through the peer configuration and get the mg profile associated peers only */
|
/* go through the peer configuration and get the mg profile associated peers only */
|
||||||
if (!(mg_peers = switch_xml_child(cfg, "mg_peers"))) {
|
if (!(mg_peers = switch_xml_child(cfg, "mg_peers"))) {
|
||||||
status = SWITCH_STATUS_FALSE;
|
status = SWITCH_STATUS_FALSE;
|
||||||
@ -345,6 +354,7 @@ static switch_xml_config_item_t *get_instructions(megaco_profile_t *profile) {
|
|||||||
//SWITCH_CONFIG_ITEM("tdm-pre-buffer-size", SWITCH_CONFIG_INT, CONFIG_RELOADABLE, &profile->tdm_pre_buffer_size, 0, &pre_buffer_len, "", "freetdm pre buffer size"),
|
//SWITCH_CONFIG_ITEM("tdm-pre-buffer-size", SWITCH_CONFIG_INT, CONFIG_RELOADABLE, &profile->tdm_pre_buffer_size, 0, &pre_buffer_len, "", "freetdm pre buffer size"),
|
||||||
SWITCH_CONFIG_ITEM("codec-prefs", SWITCH_CONFIG_STRING, 0, &profile->codec_prefs, "", &switch_config_string_strdup, "", "codec preferences, coma-separated"),
|
SWITCH_CONFIG_ITEM("codec-prefs", SWITCH_CONFIG_STRING, 0, &profile->codec_prefs, "", &switch_config_string_strdup, "", "codec preferences, coma-separated"),
|
||||||
SWITCH_CONFIG_ITEM("license", SWITCH_CONFIG_STRING, 0, &profile->license, "/usr/local/nsg/conf/license.txt", &switch_config_string_strdup, "", "License file"),
|
SWITCH_CONFIG_ITEM("license", SWITCH_CONFIG_STRING, 0, &profile->license, "/usr/local/nsg/conf/license.txt", &switch_config_string_strdup, "", "License file"),
|
||||||
|
SWITCH_CONFIG_ITEM("rtp-ip", SWITCH_CONFIG_STRING, CONFIG_RELOADABLE, &profile->rtp_ipaddr, "" , &switch_config_string_strdup, "", "rtp ip"),
|
||||||
SWITCH_CONFIG_ITEM_END()
|
SWITCH_CONFIG_ITEM_END()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -215,6 +215,7 @@ struct megaco_profile_s {
|
|||||||
char* mid; /* MG H.248 MID */
|
char* mid; /* MG H.248 MID */
|
||||||
char* my_domain; /* local domain name */
|
char* my_domain; /* local domain name */
|
||||||
char* my_ipaddr; /* local domain name */
|
char* my_ipaddr; /* local domain name */
|
||||||
|
char* rtp_ipaddr; /* local rtp ip */
|
||||||
char* port; /* port */
|
char* port; /* port */
|
||||||
char* protocol_type; /* MEGACO/MGCP */
|
char* protocol_type; /* MEGACO/MGCP */
|
||||||
char* license; /* License file location/name */
|
char* license; /* License file location/name */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user