Hello

I change this from chan_sip.conf (see ipsvr):

static void realtime_update_peer(const char *peername, struct sockaddr_in *sin, const char *username, const char *fullcontact, int expirey)
{
        char port[10];
        char ipaddr[20];
        char regseconds[20];
        time_t nowtime;
->        char ipsvr[20];

        time(&nowtime);
        nowtime += expirey;
snprintf(regseconds, sizeof(regseconds), "%d", (int)nowtime); /* Expiration time */
        ast_inet_ntoa(ipaddr, sizeof(ipaddr), sin->sin_addr);
        snprintf(port, sizeof(port), "%d", ntohs(sin->sin_port));
->        ast_inet_ntoa(ipsvr, sizeof(ipsvr), sin->sin_addr);

        if (fullcontact)
ast_update_realtime("sippeers", "name", peername, "ipaddr", ipaddr, "port", port, "regseconds", regseconds, "username", username, "fullcontact", fullcontact, "ipsvr", ipsvr, NULL);
        else
ast_update_realtime("sippeers", "name", peername, "ipaddr", ipaddr, "port", port, "regseconds", regseconds, "username", username, "ipsvr", ipsvr, NULL);
}

I need put a asterisk ip address on client was registered. But I don't know how get this address. Exist any variable ? Any struct ?

I think, this is a good idea for add to asterisk. If I have more of one asterisk in realtime database, I can send call to that server where sipendpoint was registered.

Thanks for all !!!
_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to