Fix a bug where we were passing in address information that should remain unmodified...
authorJoshua Colp <jcolp@digium.com>
Tue, 2 Jun 2009 13:12:59 +0000 (13:12 +0000)
committerJoshua Colp <jcolp@digium.com>
Tue, 2 Jun 2009 13:12:59 +0000 (13:12 +0000)
(closes issue #15243)
Reported by: pj

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@198762 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/rtp_engine.c

index 90c6471..85ee9b6 100644 (file)
@@ -278,6 +278,7 @@ int ast_rtp_instance_destroy(struct ast_rtp_instance *instance)
 
 struct ast_rtp_instance *ast_rtp_instance_new(const char *engine_name, struct sched_context *sched, struct sockaddr_in *sin, void *data)
 {
+       struct sockaddr_in address = { 0, };
        struct ast_rtp_instance *instance = NULL;
        struct ast_rtp_engine *engine = NULL;
 
@@ -315,11 +316,12 @@ struct ast_rtp_instance *ast_rtp_instance_new(const char *engine_name, struct sc
        instance->local_address.sin_family = AF_INET;
        instance->local_address.sin_addr = sin->sin_addr;
        instance->remote_address.sin_family = AF_INET;
+       address.sin_addr = sin->sin_addr;
 
        ast_debug(1, "Using engine '%s' for RTP instance '%p'\n", engine->name, instance);
 
        /* And pass it off to the engine to setup */
-       if (instance->engine->new(instance, sched, sin, data)) {
+       if (instance->engine->new(instance, sched, &address, data)) {
                ast_debug(1, "Engine '%s' failed to setup RTP instance '%p'\n", engine->name, instance);
                ao2_ref(instance, -1);
                return NULL;