summaryrefslogtreecommitdiff
path: root/channels/chan_rtp.c
diff options
context:
space:
mode:
Diffstat (limited to 'channels/chan_rtp.c')
-rw-r--r--channels/chan_rtp.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/channels/chan_rtp.c b/channels/chan_rtp.c
index 1c824fecc..6eec91e22 100644
--- a/channels/chan_rtp.c
+++ b/channels/chan_rtp.c
@@ -314,7 +314,12 @@ static struct ast_channel *unicast_rtp_request(const char *type, struct ast_form
engine_name = S_COR(ast_test_flag(&opts, OPT_RTP_ENGINE),
opt_args[OPT_ARG_RTP_ENGINE], "asterisk");
- ast_ouraddrfor(&address, &local_address);
+ ast_sockaddr_copy(&local_address, &address);
+ if (ast_ouraddrfor(&address, &local_address)) {
+ ast_log(LOG_ERROR, "Could not get our address for sending media to '%s'\n",
+ args.destination);
+ goto failure;
+ }
instance = ast_rtp_instance_new(engine_name, NULL, &local_address, NULL);
if (!instance) {
ast_log(LOG_ERROR,