[Home]

Summary:ASTERISK-27168: alembic: PJSIP scripts are missing column dtls_fingerprint in ps_endpoints table
Reporter:Florian Floimair (f.floimair)Labels:fax pjsip
Date Opened:2017-08-01 08:39:57Date Closed:2017-08-28 06:44:59
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Resources/res_pjsip
Versions:14.6.0 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Debian 9 amd64, Attachments:
Description:git commit adba2a8d7fd added a dtls_fingerprint option to res_pjsip, however this change never made it to the alembic scripts and therefore the ps_endpoint table is missing a column.

When trying to use ARI to create PJSIP endpoints as outlined in this wiki article:
https://wiki.asterisk.org/wiki/display/AST/ARI+Push+Configuration
an error occurs which can be seen in the CLI and in the logs stating:
{noformat}
res_config_odbc.c: SQL Prepare failed! [INSERT INTO ps_endpoints (id, rpid_immediate, device_state_busy_at, t38_udptl_maxdatagram, dtls_rekey, named_pickup_group, direct_media_method, send_rpid, pickup_group, sdp_session, dtls_verify, message_context, mailboxes, record_on_feature, dtls_private_key, dtls_fingerprint, from_domain, timers_sess_expires, named_call_group, dtls_cipher, media_encryption_optimistic, aors, identify_by, callerid_privacy, mwi_subscribe_replaces_unsolicited, cos_audio, context, rtp_symmetric, transport, moh_suggest, t38_udptl, fax_detect, tos_video, srtp_tag_32, use_avpf, call_group, fax_detect_timeout, sdp_owner, force_rport, callerid_tag, rtp_timeout_hold, use_ptime, media_address, voicemail_extension, rtp_timeout, set_var, contact_acl, force_avp, record_off_feature, from_user, send_diversion, t38_udptl_ipv6, tone_zone, language, allow_subscribe, rtp_ipv6, callerid, moh_passthrough, cos_video, asymmetric_rtp_codec, ice_support, aggregate_mwi, one_touch_recording, mwi_from_user, accountcode, allow, rewrite_contact, user_eq_phone, rtp_engine, subscribe_context, auth, direct_media_glare_mitigation, trust_id_inbound, bind_rtp_to_media_address, disable_direct_media_on_nat, media_encryption, media_use_received_transport, allow_overlap, dtmf_mode, outbound_auth, tos_audio, dtls_cert_file, dtls_ca_path, dtls_setup, connected_line_method, g726_non_standard, 100rel, timers, direct_media, acl, timers_min_se, trust_id_outbound, sub_min_expiry, rtcp_mux, send_pai, rtp_keepalive, t38_udptl_ec, t38_udptl_nat, allow_transfer, dtls_ca_file, outbound_proxy, inband_progress) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]
{noformat}
By comparing the attributes in the JSON output of the curl statement and the columns in the database it is obvious that dtls_fingerprint is missing in the table but present in the JSON output.

After manually inserting the column into the ps_endpoints table using

ALTER table ps_endpoints add dtls_fingerprint char(255);

the error no longer is present.



---

As a sidenote:

In addition to the missing attribute there are few columns in the database table that do not match to a JSON attribute in the pjsip endpoint object.
These are:
- contact_deny
- contact_permit
- contact_user
- deny
- disallow
- external_media_address
- permit
- redirect_method

maybe these should be removed
Comments:By: Asterisk Team (asteriskteam) 2017-08-01 08:39:58.214-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

By: Florian Floimair (f.floimair) 2017-08-23 10:06:13.703-0500

After some studying of the Asterisk source code I revised my hotfix in the database mentioned above to using the following command (in MySQL/MariaDB):
ALTER TABLE ps_endpoints ADD dtls_fingerprint ENUM('SHA-1','SHA-256') NULL;

I'm currently in the process of writing an alembic script for this.
It already looks quite promising so far. I will try to get this into gerrit this week so you can have a look at it.


By: Florian Floimair (f.floimair) 2017-08-25 05:07:13.716-0500

I submitted my changes to gerrit.
https://gerrit.asterisk.org/#/c/6297/


By: Friendly Automation (friendly-automation) 2017-08-28 06:45:01.837-0500

Change 6297 merged by Jenkins2:
alembic: Add dtls_fingerprint column in ps_endpoints table

[https://gerrit.asterisk.org/6297|https://gerrit.asterisk.org/6297]

By: Friendly Automation (friendly-automation) 2017-08-28 06:45:05.560-0500

Change 6304 merged by Jenkins2:
alembic: Add dtls_fingerprint column in ps_endpoints table

[https://gerrit.asterisk.org/6304|https://gerrit.asterisk.org/6304]

By: Friendly Automation (friendly-automation) 2017-08-28 06:49:44.597-0500

Change 6306 merged by Jenkins2:
alembic: Add dtls_fingerprint column in ps_endpoints table

[https://gerrit.asterisk.org/6306|https://gerrit.asterisk.org/6306]

By: Friendly Automation (friendly-automation) 2017-08-28 07:13:21.093-0500

Change 6305 merged by Joshua Colp:
alembic: Add dtls_fingerprint column in ps_endpoints table

[https://gerrit.asterisk.org/6305|https://gerrit.asterisk.org/6305]

By: Friendly Automation (friendly-automation) 2017-09-07 12:21:47.596-0500

Change 6433 merged by Joshua Colp:
alembic: Add dtls_fingerprint column in ps_endpoints table

[https://gerrit.asterisk.org/6433|https://gerrit.asterisk.org/6433]