Function ast_rtp_new_with_bindaddr in chan_h323.c

Hello everybody,

I am looking for kind help regarding a function argument/Variable.

As I am not really a Pro in Asterisk or C/C++ I come here hopping to find some more help :smile:

When I make a call from NetMeeting to Asterisk (H323), it make my Asterisk crashes and display :

[quote]
[May 21 04:29:31] WARNING[25611]: rtp.c:2211 rtp_socket: Unknown address family: 127
[May 21 04:29:31] WARNING[25611]: chan_h323.c:968 __oh323_rtp_create: Unable to create RTP session: Success
[May 21 04:29:31] ERROR[25611]: chan_h323.c:1917 external_rtp_create: No RTP stream is available for call ip$192.168.102.76:2773/32447 (32447) ERROR: on_external_rtp_create failure
[May 21 04:29:31] WARNING[25611]: rtp.c:2211 rtp_socket: Unknown address family: 127
[May 21 04:29:31] WARNING[25611]: chan_h323.c:968 __oh323_rtp_create: Unable to create RTP session: Success
[May 21 04:29:31] ERROR[25611]: chan_h323.c:1917 external_rtp_create: No RTP stream is available for call ip$192.168.102.76:2773/32447 (32447) ERROR: on_external_rtp_create failure
[May 21 04:29:31] WARNING[25611]: rtp.c:2211 rtp_socket: Unknown address family: 127
[May 21 04:29:31] WARNING[25611]: chan_h323.c:968 __oh323_rtp_create: Unable to create RTP session: Success[/quote]

So I had a look at my compile error and especially to this function in chan_h323.c : ast_rtp_new_with_bindaddr

Function which is defined in rtp.c as :

And my problem is that I miss the last argument socklen_t addrlen, I tried to use a dummy or a NULL but doesnt help…

So I am wondering if soemone understand this last argument and could help me to know what to put insted of the XxxX

static int __oh323_rtp_create(struct oh323_pvt *pvt)
{
struct in_addr our_addr;
socklen_t dummy;
if (pvt->rtp)
return 0;

    if (ast_find_ourip(&our_addr, bindaddr)) {
            ast_mutex_unlock(&pvt->lock);
            ast_log(LOG_ERROR, "Unable to locate local IP address for RTP stream\n");
            return -1;
    }
    pvt->rtp = [b]ast_rtp_new_with_bindaddr(sched, io, 1, 0, &our_addr, XxxX);[/b]
    if (!pvt->rtp) {
            ast_mutex_unlock(&pvt->lock);
            ast_log(LOG_WARNING, "Unable to create RTP session: %s\n", strerror(errno));
            return -1;
    }

Thank you to have read me and even more if you can help or try to ^^

Here are the output Warning I have when compiling :

[quote]
chan_h323.c: In function â__oh323_rtp_createâ:
chan_h323.c:965: warning: passing argument 5 of âast_rtp_new_with_bindaddrâ from incompatible pointer type
chan_h323.c:965: warning: passing argument 6 of âast_rtp_new_with_bindaddrâ makes integer from pointer without a cast[/quote]

what version of asterisk are you running? I am seeing a different function specification for ast_rtp_new_with_bindaddr

I am running Asteriskv6 which is the January 2008 trunk with a SIP IPv6 integrated.