[asterisk-bugs] [JIRA] (ASTERISK-22374) Finish mapping the sip.conf parameters to res_sip.conf parameters

Alexander Traud (JIRA) noreply at issues.asterisk.org
Thu Aug 18 08:23:56 CDT 2016


     [ https://issues.asterisk.org/jira/browse/ASTERISK-22374?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexander Traud updated ASTERISK-22374:
---------------------------------------

    Attachment: tls_client_method.patch
                system.patch
                session-timers.patch
                register_username.patch
                register_transport.patch
                merge_value.patch
                extern.patch
                expiry.patch
                encryption.patch
                cos_and_tos.patch
                certificates.patch

Thanks to this Python script, the migration from the channel driver chan_sip to the channel driver based on the PJProject (res_pjsip) was much easier.

However, my sip.conf was not migrated completely. Looking at the source of the Python script revealed several different causes, ranging from simple typos, over wrong value names, different defaults, dead functions, re-naming issues, parsing errors, to architectural misunderstandings. I did not do a full code review but fixed those issues which just my sip.conf revealed:

- media_encryption was not printed to pjsip.conf, because of scrambled letters; fixed through {{encryption.patch}}

- cos and tos were not printed to pjsip.conf, as they were not found in sip.conf, because of scrambled letters. Furthermore now, set_value was called with one to much parameter and with one wrong parameter value, because of a copy-and-paste error; fixed in {{cos_and_tos.patch}}

- session-timers=accept and session-timers=refuse were migrated to wrong values; fixed through {{session-timers.patch}}

- local_net, contact_acl, contact_deny, contact_permit were not printed to pjsip.conf, because these keys have a different name than in sip.conf; fixed through {{merge_value.patch}}

- compactheaders, timerb, timert1, useragent were not mapped to pjsip.conf, because no section of type=system was created; fixed through {{system.patch}}

- defaultexpiry, maxexpiry, and minexpiry were not mapped to pjsip.conf (AOR) why ever; fixed through {{expiry.patch}}

- externip and externhost were mapped into each Endpoint instead of the Transports. This is not supported by PJProject and all Endpoints got rejected. Fixed through {{extern.patch}}

- username was only printed to pjsip.conf, if the (optional) field ‘authname’ was present in the register string. This happened because of a logical error. Now, the (mandatory) field ‘user’ is printed, if there is no authname, see {{register_username.patch}}

- if the register string started with tls://, tcp://, or udp://, the whole string was parsed incorrectly because the amount of colons was not calculated correctly. Furthermore, UDP was used always. Fixed through {{register_transport.patch}}.

- tlscertfile was not mapped to pjsip.conf, although mentioned in the comments. tlscapath was not mapped, because it was introduced later with and nobody updated the migration script. Fixed through {{certificates.patch}}

- tlsclientmethod of chan_sip has a different default value (sslv23) than ‘method’ in PJProject (tlsv1). The latter disables TLSv1.2. Therefore, if that key does not exist in sip.conf, it must be printed in pjsip.conf. Furthermore, the setting changed in semantic, because in chan_sip it is just for outgoing client connections. In PJProject, this setting affects both client and server. This was fixed through {{tls_client_method.patch}} which displays a note to the user, when this was set in chan_sip. By the way, setting this in chan_sip was wrong in near to all cases, because it disabled TLSv1.2 there.

- none-mapped keys are added at the top of the resulting pjsip.conf. That does not work reliable because only the first key of each section is mentioned there. It should display all affected keys. Furthermore, that list contains false negatives because the keys are filtered against those keys which were in a chan_sip Peer. Keys which are just listed in the General section, are listed as not-mapped (like bindaddr) although they were mapped.

I fixed all those issues except the last one. I hope those changes help others and are considered to be included.

> Finish mapping the sip.conf parameters to res_sip.conf parameters
> -----------------------------------------------------------------
>
>                 Key: ASTERISK-22374
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-22374
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Contrib/General, Resources/res_pjsip
>    Affects Versions: 12, 12.0.0-alpha1
>            Reporter: Matt Jordan
>            Assignee: Mark Michelson
>         Attachments: certificates.patch, cos_and_tos.patch, encryption.patch, expiry.patch, extern.patch, merge_value.patch, register_transport.patch, register_username.patch, session-timers.patch, system.patch, tls_client_method.patch
>
>
> The sip to res_pjsip script still needs a number of mappings. These include the following:
> {noformat}
> #### maps to auth ###
> #        type = auth
> #        username
> #        password
> #        md5_cred
> #        realm
> #        nonce_lifetime
> #        auth_type
> ### maps to transport ###
> #        type = transport
> #        protocol
> #        bind
> #        async_operations
> #        ca_list_file
> #        cert_file
> #        privkey_file
> #        password
> #        external_signaling_address - externip & externhost
> #        external_signaling_port
> #        external_media_address
> #        domain
> #        verify_server
> #        verify_client
> #        require_client_cert
> #        method
> #        cipher
> #        localnet
> ### maps to domain_alias ###
> #        type = domain_alias
> #        domain
> ### maps to registration ###
> #        type = registration
> #        server_uri
> #        client_uri
> #        contact_user
> #        transport
> #        outbound_proxy
> #        expiration
> #        retry_interval
> #        max_retries
> #        auth_rejection_permanent
> #        outbound_auth
> ### maps to identify ###
> #        type = identify
> #        endpoint
> #        match
> {noformat}
> Let's knock out as many as possible :-)



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list