From 152fa151e076d84f8a8b7d7962b053f47608cfaf Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Sat, 25 Nov 2006 08:46:48 +0000 Subject: Fixed bug in siprtp: media transport was incorrectly NULL-ed after end of call, causing next call to fail git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@829 74dad513-b988-da41-8d7b-12977e46ad98 --- pjsip-apps/src/samples/siprtp.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'pjsip-apps/src') diff --git a/pjsip-apps/src/samples/siprtp.c b/pjsip-apps/src/samples/siprtp.c index 10d796e7..65b71608 100644 --- a/pjsip-apps/src/samples/siprtp.c +++ b/pjsip-apps/src/samples/siprtp.c @@ -292,6 +292,7 @@ static pj_status_t init_sip() { pj_sockaddr_in addr; pjsip_host_port addrname; + pjsip_transport *tp; pj_bzero(&addr, sizeof(addr)); addr.sin_family = PJ_AF_INET; @@ -313,11 +314,15 @@ static pj_status_t init_sip() status = pjsip_udp_transport_start( app.sip_endpt, &addr, (app.local_addr.slen ? &addrname:NULL), - 1, NULL); + 1, &tp); if (status != PJ_SUCCESS) { app_perror(THIS_FILE, "Unable to start UDP transport", status); return status; } + + PJ_LOG(3,(THIS_FILE, "SIP UDP listening on %.*s:%d", + (int)tp->local_name.host.slen, tp->local_name.host.ptr, + tp->local_name.port)); } /* @@ -380,9 +385,6 @@ static void destroy_sip() app.sip_endpt = NULL; } - /* Shutdown PJLIB */ - pj_shutdown(); - } @@ -1457,10 +1459,7 @@ static void destroy_call_media(unsigned call_index) audio->thread_quit_flag = 0; } - if (audio->transport) { - pjmedia_transport_detach(audio->transport, audio); - audio->transport = NULL; - } + pjmedia_transport_detach(audio->transport, audio); } } @@ -2119,6 +2118,8 @@ int main(int argc, char *argv[]) app_logging_shutdown(); + /* Shutdown PJLIB */ + pj_shutdown(); return 0; } -- cgit v1.2.3