Merge "bridge_native_rtp: Handle case where channel joins already suspended."
authorzuul <zuul@gerrit.asterisk.org>
Tue, 28 Feb 2017 23:14:25 +0000 (17:14 -0600)
committerGerrit Code Review <gerrit2@gerrit.digium.api>
Tue, 28 Feb 2017 23:14:25 +0000 (17:14 -0600)
configs/samples/pjsip.conf.sample
res/res_pjsip.c
res/res_pjsip/pjsip_options.c
res/res_pjsip_outbound_publish.c
res/res_pjsip_outbound_registration.c

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 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);