dbr.url format

(2 posts) (1 voice)
  1. drraab, Member

    Hello,

    I have a procedure as shown below querying tables that are partitioned by date(day).

    Now I am trying to use dbr.url so that "callid" column will be clickable and should open an external webpage. A working example to open that page would be

    http://127.0.0.1/homer/#/result?query(trancall:'true',startdate:'2016-04-08',endts:'2016-04-09',search_callid:'x40f3dabb-679cd5b3-6377be7f-9191@192.168.0.1')

    The callid from select should also be used in URL as search_callid: parameter. The date values are also different so I guess I need to reformat those to %Y-%m-%d.

    select 'dbr.url', external_url_base, 'URL name', [ColumnReference, ] [embed_target, ] [<=ColumnReference/ParameterReference to be added to base URL] [parameter_name=ColumnReference/ParameterReference, ...]

    I've been trying to write a usable dbr.url format been I have not been successfull at all.

    Can you please provide a working dbr.url for this example?


    DROP PROCEDURE IF EXISTS sp_DBR_FunFox_CallOverview
    $$
    CREATE PROCEDURE `sp_DBR_FunBox_CallOverview`()
    BEGIN set @usetableday = concat("mydatabase.my_table_", DATE_FORMAT(CURDATE(), '%Y%m%d'));
    set @myquery = concat_ws(" ", "select callid, id, date, ruri, from_user, to_user, to_domain, case when from_domain like '1.2.3.%' then 'nasavisits' else from_domain end as from_domain, source_ip, source_port, destination_ip, destination_port, contact_ip, contact_port from",@usetableday,"where method = 'INVITE' and id in ( SELECT MIN(id) FROM",@usetableday," where method = 'INVITE' GROUP BY callid ) order by id desc");
    PREPARE my_stmt FROM @myquery;
    EXECUTE my_stmt; END
    $$

  2. drraab, Member

    Let me try to simplify the question a bit. This is the URL I want to end up with:

    http://127.0.0.1/homer/#/result?query(trancall:'true',startdate:'2016-04-08',endts:'2016-04-09',search_callid:'x40f3dabb-679cd5b3-6377be7f-9191@192.168.0.1')

    How can I pass start_date, end_date and callid into startdate, endts and search_callid with the given format above?

    As you can see there are #,?,',:,-,@ etc. characters used.
    Must I escape these somehow as the dbr.url also uses the ' character in it's format?


Reply

You must log in to post.