Merge "build: Warn if asterisk is installed in both 32 and 64 bit sys dirs"
authorJoshua Colp <jcolp@digium.com>
Tue, 28 Feb 2017 23:47:46 +0000 (17:47 -0600)
committerGerrit Code Review <gerrit2@gerrit.digium.api>
Tue, 28 Feb 2017 23:47:46 +0000 (17:47 -0600)
bridges/bridge_native_rtp.c
configs/samples/pjsip.conf.sample
include/asterisk/bridge_technology.h
res/res_pjsip.c
res/res_pjsip/pjsip_options.c
res/res_pjsip_outbound_publish.c
res/res_pjsip_outbound_registration.c
res/res_pjsip_pubsub.c

index e011f50..77e321f 100644 (file)
@@ -129,7 +129,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);
@@ -145,7 +145,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:
index 323100b..b18fdb2 100644 (file)
                         ; when placing on hold and sendrecv when taking off hold
 ;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")
 ;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=========================
 ;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
 ;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
index 8df19d9..843d93c 100644 (file)
@@ -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);
        /*!
index 9782cc9..810b6d3 100644 (file)
                                        </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>
index 6fd3c25..662166c 100644 (file)
@@ -1250,8 +1250,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);
index 53eb6ac..a19a9bb 100644 (file)
@@ -69,7 +69,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>
index 137f3a8..3b635a1 100644 (file)
@@ -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>
@@ -1209,6 +1209,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);
 
 
index 709dc66..e905024 100644 (file)
@@ -1456,7 +1456,6 @@ static int sub_persistence_recreate(void *obj)
                ast_log(LOG_WARNING, "Failed recreating '%s' subscription: The endpoint was not found\n",
                        persistence->endpoint);
                ast_sorcery_delete(ast_sip_get_sorcery(), persistence);
-               ao2_ref(endpoint, -1);
                return 0;
        }