diff options
author | Benny Prijono <bennylp@teluu.com> | 2007-10-30 16:41:45 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2007-10-30 16:41:45 +0000 |
commit | c12a8688e01bbb4a3b4f881695f52a183f063b43 (patch) | |
tree | 37b02c744e55cdb8a625833a7df394ebbf94cecf | |
parent | c9d49b32bb68ff6a4d2c0ba6be071b888ec8e125 (diff) |
Fixed route set bug in simpleua.c (thanks Raquie Rawq)
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1530 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r-- | pjsip-apps/src/samples/simpleua.c | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/pjsip-apps/src/samples/simpleua.c b/pjsip-apps/src/samples/simpleua.c index 48cea122..edf0b838 100644 --- a/pjsip-apps/src/samples/simpleua.c +++ b/pjsip-apps/src/samples/simpleua.c @@ -235,6 +235,9 @@ int main(int argc, char *argv[]) PJ_ASSERT_RETURN(status == PJ_SUCCESS, 1); } + /* Initialize 100rel support */ + status = pjsip_100rel_init_module(g_endpt); + PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); /* * Register our module to receive incoming requests. @@ -334,6 +337,26 @@ int main(int argc, char *argv[]) */ + /* Get the SDP body to be put in the outgoing INVITE, by asking + * media endpoint to create one for us. The SDP will contain all + * codecs that have been registered to it (in this case, only + * PCMA and PCMU), plus telephony event. + */ + status = pjmedia_endpt_create_sdp( g_med_endpt, /* the media endpt */ + dlg->pool, /* pool. */ + 1, /* # of streams */ + &g_med_skinfo, /* RTP sock info */ + &local_sdp); /* the SDP result */ + PJ_ASSERT_RETURN(status == PJ_SUCCESS, 1); + + + + /* Create the INVITE session, and pass the SDP returned earlier + * as the session's initial capability. + */ + status = pjsip_inv_create_uac( dlg, local_sdp, 0, &g_inv); + PJ_ASSERT_RETURN(status == PJ_SUCCESS, 1); + /* If we want the initial INVITE to travel to specific SIP proxies, * then we should put the initial dialog's route set here. The final * route set will be updated once a dialog has been established. @@ -360,28 +383,6 @@ int main(int argc, char *argv[]) * Note that Route URI SHOULD have an ";lr" parameter! */ - - /* Get the SDP body to be put in the outgoing INVITE, by asking - * media endpoint to create one for us. The SDP will contain all - * codecs that have been registered to it (in this case, only - * PCMA and PCMU), plus telephony event. - */ - status = pjmedia_endpt_create_sdp( g_med_endpt, /* the media endpt */ - dlg->pool, /* pool. */ - 1, /* # of streams */ - &g_med_skinfo, /* RTP sock info */ - &local_sdp); /* the SDP result */ - PJ_ASSERT_RETURN(status == PJ_SUCCESS, 1); - - - - /* Create the INVITE session, and pass the SDP returned earlier - * as the session's initial capability. - */ - status = pjsip_inv_create_uac( dlg, local_sdp, 0, &g_inv); - PJ_ASSERT_RETURN(status == PJ_SUCCESS, 1); - - /* Create initial INVITE request. * This INVITE request will contain a perfectly good request and * an SDP body as well. |