Ok sorry I got confused ! For creating the socket, I reused the code from simpleua.c : pj_sockaddr_in addr; addr.sin_family = pj_AF_INET(); addr.sin_addr.s_addr = 0; addr.sin_port = pj_htons(5060); status = pjsip_udp_transport_start( g_endpt, &addr, NULL, 1, NULL); if (status != PJ_SUCCESS) { app_perror(THIS_FILE, "Unable to start UDP transport", status); return 1; } So I can't directly use getsockname(). Can I still get my listening address this way ? On Thu, May 15, 2008 at 2:50 PM, Benny Prijono <bennylp at pjsip.org> wrote: > On Thu, May 15, 2008 at 7:43 PM, Damien Herraud <d.herraud at gmail.com> > wrote: > > Thank you very much for the answer ! > > > > > > On Thu, May 15, 2008 at 2:26 PM, Benny Prijono <bennylp at pjsip.org> > wrote: > > > > > > > > On Thu, May 15, 2008 at 6:10 PM, Damien Herraud <d.herraud at gmail.com> > > wrote: > > > > Hi, > > > > > > > > > > > > I try to register on an IMS network (in a LAN) using pjsip-lib (and > not > > > > pjsua, following a discussion I had on this list). I try to use > > > > pjsip_regc_init function but I don't understand what I have to put in > > the > > > > "contact" string in argument. > > > > > > The contact should contain one or more address where the client is > > > expecting request to be sent to. Since you're working in a LAN, just > > > put your listening SIP address/port there, e.g. > > > "sip:user at 192.x.x.x:5080" > > > > By listening SIP address, do you mean the one I want to register with ? > For > > example, if I want to register as alice, I would put > > "sip:alice at open-ims.test:5080" ? > > > > Mmm.. not really. The host part normally contains your IP address, and > the port contains the port where you created your SIP listener on. > > The listening address is basically getsockname(your_sip_socket). > > Cheers > Benny > > > > Cheers, > > > > Damien > > > > > > _______________________________________________ > > Visit our blog: http://blog.pjsip.org > > > > pjsip mailing list > > pjsip at lists.pjsip.org > > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > > > > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip at lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20080515/be85a868/attachment.html