diff options
-rw-r--r-- | bridges/bridge_native_rtp.c | 6 | ||||
-rw-r--r-- | configs/samples/pjsip.conf.sample | 19 | ||||
-rw-r--r-- | include/asterisk/bridge_technology.h | 3 | ||||
-rw-r--r-- | res/res_pjsip.c | 2 | ||||
-rw-r--r-- | res/res_pjsip/pjsip_options.c | 4 | ||||
-rw-r--r-- | res/res_pjsip_outbound_publish.c | 2 | ||||
-rw-r--r-- | res/res_pjsip_outbound_registration.c | 13 |
7 files changed, 32 insertions, 17 deletions
diff --git a/bridges/bridge_native_rtp.c b/bridges/bridge_native_rtp.c index a106d2d5f..a80ef4c5a 100644 --- a/bridges/bridge_native_rtp.c +++ b/bridges/bridge_native_rtp.c @@ -131,7 +131,7 @@ static void native_rtp_bridge_start(struct ast_bridge *bridge, struct ast_channe { struct ast_bridge_channel *bc0 = AST_LIST_FIRST(&bridge->channels); struct ast_bridge_channel *bc1 = AST_LIST_LAST(&bridge->channels); - enum ast_rtp_glue_result native_type; + enum ast_rtp_glue_result native_type = AST_RTP_GLUE_RESULT_FORBID; struct ast_rtp_glue *glue0, *glue1; RAII_VAR(struct ast_rtp_instance *, instance0, NULL, ao2_cleanup); RAII_VAR(struct ast_rtp_instance *, instance1, NULL, ao2_cleanup); @@ -147,7 +147,9 @@ static void native_rtp_bridge_start(struct ast_bridge *bridge, struct ast_channe } ast_channel_lock_both(bc0->chan, bc1->chan); - native_type = native_rtp_bridge_get(bc0->chan, bc1->chan, &glue0, &glue1, &instance0, &instance1, &vinstance0, &vinstance1); + if (!bc0->suspended && !bc1->suspended) { + native_type = native_rtp_bridge_get(bc0->chan, bc1->chan, &glue0, &glue1, &instance0, &instance1, &vinstance0, &vinstance1); + } switch (native_type) { case AST_RTP_GLUE_RESULT_LOCAL: diff --git a/configs/samples/pjsip.conf.sample b/configs/samples/pjsip.conf.sample index bb2ad94f8..f66161329 100644 --- a/configs/samples/pjsip.conf.sample +++ b/configs/samples/pjsip.conf.sample @@ -640,7 +640,7 @@ ;moh_suggest=default ; Default Music On Hold class (default: "default") ;outbound_auth= ; Authentication object used for outbound requests (default: ; "") -;outbound_proxy= ; Proxy through which to send requests a full SIP URI +;outbound_proxy= ; Proxy through which to send requests, a full SIP URI ; must be provided (default: "") ;rewrite_contact=no ; Allow Contact header to be rewritten with the source ; IP address port (default: "no") @@ -865,8 +865,8 @@ ;qualify_timeout=3.0 ; Qualify timeout in fractional seconds (default: "3.0") ;authenticate_qualify=no ; Authenticates a qualify request if needed ; (default: "no") -;outbound_proxy= ; Outbound proxy used when sending OPTIONS request - ; (default: "") +;outbound_proxy= ; Proxy through which to send OPTIONS requests, a full SIP URI + ; must be provided (default: "") ;==========================SYSTEM SECTION OPTIONS========================= @@ -898,11 +898,10 @@ ;max_forwards=70 ; Value used in Max Forwards header for SIP requests ; (default: "70") ;type= ; Must be of type global (default: "") -;user_agent=Asterisk PBX SVN-branch-12-r404375 ; Value used in User Agent - ; header for SIP requests and - ; Server header for SIP - ; responses (default: "Asterisk - ; PBX SVN-branch-12-r404375") +;user_agent=Asterisk PBX ; Allows you to change the user agent string + ; The default user agent string also contains + ; the Asterisk version. If you don't want to + ; expose this, change the user_agent string. ;default_outbound_endpoint=default_outbound_endpoint ; Endpoint to use when ; sending an outbound ; request to a URI @@ -1033,8 +1032,8 @@ ;max_retries=10 ; Maximum number of registration attempts (default: "10") ;outbound_auth= ; Authentication object to be used for outbound registrations ; (default: "") -;outbound_proxy= ; Outbound Proxy used to send registrations (default: - ; "") +;outbound_proxy= ; Proxy through which to send registrations, a full SIP URI + ; must be provided (default: "") ;retry_interval=60 ; Interval in seconds between retries if outbound ; registration is unsuccessful (default: "60") ;forbidden_retry_interval=0 ; Interval used when receiving a 403 Forbidden diff --git a/include/asterisk/bridge_technology.h b/include/asterisk/bridge_technology.h index 7f5d746f8..402b54e98 100644 --- a/include/asterisk/bridge_technology.h +++ b/include/asterisk/bridge_technology.h @@ -110,6 +110,9 @@ struct ast_bridge_technology { * * \note The bridge technology must tollerate a failed to join channel * until it can be kicked from the bridge. + * + * \note A channel may be in a suspended state already when joining a bridge + * technology. The technology must handle this case. */ int (*join)(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel); /*! diff --git a/res/res_pjsip.c b/res/res_pjsip.c index 92dca7fb8..54a0a5f39 100644 --- a/res/res_pjsip.c +++ b/res/res_pjsip.c @@ -349,7 +349,7 @@ </description> </configOption> <configOption name="outbound_proxy"> - <synopsis>Proxy through which to send requests, a full SIP URI must be provided</synopsis> + <synopsis>Full SIP URI of the outbound proxy used to send requests</synopsis> </configOption> <configOption name="rewrite_contact"> <synopsis>Allow Contact header to be rewritten with the source IP address-port</synopsis> diff --git a/res/res_pjsip/pjsip_options.c b/res/res_pjsip/pjsip_options.c index d4159f508..d4ea911c9 100644 --- a/res/res_pjsip/pjsip_options.c +++ b/res/res_pjsip/pjsip_options.c @@ -1260,8 +1260,8 @@ int ast_sip_format_contact_ami(void *obj, void *arg, int flags) if (!ast_strlen_zero(contact->call_id)) { ast_str_append(&buf, 0, "CallID: %s\r\n", contact->call_id); } - ast_str_append(&buf, 0, "Status: %s\r\n", ast_sip_get_contact_status_label(status->status)); - if (status->status == UNKNOWN) { + ast_str_append(&buf, 0, "Status: %s\r\n", ast_sip_get_contact_status_label(status ? status->status : UNKNOWN)); + if (!status || status->status == UNKNOWN) { ast_str_append(&buf, 0, "RoundtripUsec: N/A\r\n"); } else { ast_str_append(&buf, 0, "RoundtripUsec: %" PRId64 "\r\n", status->rtt); diff --git a/res/res_pjsip_outbound_publish.c b/res/res_pjsip_outbound_publish.c index 37f64481e..0273c6a68 100644 --- a/res/res_pjsip_outbound_publish.c +++ b/res/res_pjsip_outbound_publish.c @@ -68,7 +68,7 @@ </description> </configOption> <configOption name="outbound_proxy" default=""> - <synopsis>SIP URI of the outbound proxy used to send publishes</synopsis> + <synopsis>Full SIP URI of the outbound proxy used to send publishes</synopsis> </configOption> <configOption name="server_uri"> <synopsis>SIP URI of the server and entity to publish to</synopsis> diff --git a/res/res_pjsip_outbound_registration.c b/res/res_pjsip_outbound_registration.c index 122d5bb69..622df03f7 100644 --- a/res/res_pjsip_outbound_registration.c +++ b/res/res_pjsip_outbound_registration.c @@ -96,7 +96,7 @@ </description> </configOption> <configOption name="outbound_proxy" default=""> - <synopsis>Outbound Proxy used to send registrations</synopsis> + <synopsis>Full SIP URI of the outbound proxy used to send registrations</synopsis> </configOption> <configOption name="retry_interval" default="60"> <synopsis>Interval in seconds between retries if outbound registration is unsuccessful</synopsis> @@ -1210,6 +1210,17 @@ static int sip_outbound_registration_regc_alloc(void *data) return -1; } + if (!ast_strlen_zero(registration->outbound_proxy)) { + pj_strdup2_with_null(pool, &tmp, registration->outbound_proxy); + uri = pjsip_parse_uri(pool, tmp.ptr, tmp.slen, 0); + if (!uri) { + ast_log(LOG_ERROR, "Invalid outbound proxy URI '%s' specified on outbound registration '%s'\n", + registration->outbound_proxy, ast_sorcery_object_get_id(registration)); + pjsip_endpt_release_pool(ast_sip_get_pjsip_endpoint(), pool); + return -1; + } + } + pjsip_endpt_release_pool(ast_sip_get_pjsip_endpoint(), pool); |