Results 1 to 3 of 3

Thread: Procedure to update the Asterisk version

  1. #1
    agauthier Guest

    Default Procedure to update the Asterisk version

    The following instructions can be used to update the PADS asterisk version to a different one that is specified in <PADS>/package/asterisk/asterisk.mk

    1) Download the Asterisk version of choice into a particular directory on your linux machine.
    2) Recursively copy ./asterisk-1.4.x/ into ./asterisk-1.4.x_orig/
    3) Add the following lines in /asterisk-1.4.x/pbx/pbx_config.c (the ones marked with // Added for PIKA)
    3a) It would be best to get the actual .patch files for this for example ftp://ftp.pikatech.com/outgoing/pads...isk_1_4_31.tgz.


    static void pbx_load_users(void)
    {
    struct ast_config *cfg;
    char *cat, *chan;
    const char *dahdichan;
    const char *pikachan; // Added for PIKA
    const char *hasexten;
    char tmp[256];
    char iface[256];
    char zapcopy[256];
    char pikacopy[256]; // Added for PIKA
    char pika_dev[256]; // Added for PIKA
    char *c;
    int len;
    int hasvoicemail;
    int start, finish, x;
    struct ast_context *con = NULL;

    .................................................. ..............................
    .................................................. ..............................
    .................................................. ..............................


    for (x = start; x <= finish; x++) {
    snprintf(tmp, sizeof(tmp), "%s/%d", dahdi_chan_name, x);
    append_interface(iface, sizeof(iface), tmp);
    }
    chan = strsep(&c, ",");
    }
    }
    pikachan = ast_variable_retrieve(cfg, cat, "pikachan"); // Added for PIKA
    if (!pikachan) // Added for PIKA
    pikachan = ast_variable_retrieve(cfg, "general", "pikachan"); // Added for PIKA
    if (!ast_strlen_zero(pikachan)) { // Added for PIKA
    ast_copy_string(pikacopy, pikachan, sizeof(pikacopy)); // Added for PIKA
    c = pikacopy; // Added for PIKA
    chan = strsep(&c, ","); // Added for PIKA
    while (chan) { // Added for PIKA
    if (sscanf(chan, "%s", pika_dev)) { // Added for PIKA
    snprintf(tmp, sizeof(tmp), "PIKA/%s", pika_dev); // Added for PIKA
    append_interface(iface, sizeof(iface), tmp); // Added for PIKA
    } // Added for PIKA
    chan = strsep(&c, ","); // Added for PIKA
    } // Added for PIKA
    } // Added for PIKA
    if (!ast_strlen_zero(iface)) {
    /* Only create a context here when it is really needed. Otherwise default empty context
    created by pbx_config may conflict with the one explicitly created by pbx_ael */
    if (!con)
    con = ast_context_find_or_create(&local_contexts, userscontext, registrar);


    4) Modify the following lines in ./asterisk-1.4.x/sounds/sounds.xml ("+" to add, "-" to remove)
    <member name="CORE-SOUNDS-EN-WAV" displayname="English, WAV format">
    </member>
    <member name="CORE-SOUNDS-EN-ULAW" displayname="English, mu-Law format">
    + <defaultenabled>yes</defaultenabled>
    </member>
    <member name="CORE-SOUNDS-EN-ALAW" displayname="English, a-Law format">
    </member>
    <member name="CORE-SOUNDS-EN-GSM" displayname="English, GSM format" >
    - <defaultenabled>yes</defaultenabled>
    </member>
    <member name="CORE-SOUNDS-EN-G729" displayname="English, G.729 format">
    </member>

    5) Create the asterisk.patch file by invoking the diff command
    # diff -Naur ./asterisk-1.4.x_orig/ ./asterisk-1.4.x/ asterisk.patch

    6) Modify dsp.c to include GSM related changes
    /Enable below to tweak for low bit rate AMR GSM detection
    // #define GSM_TWEAKS 0
    //Added to force RADIO RELAX
    #define RADIO_RELAX 1 // Added for PIKA

    #ifdef GSM_TWEAKS
    #define RADIO_RELAX 1
    #endif

    #ifdef RADIO_RELAX
    #ifdef GSM_TWEAKS
    #define DTMF_NORMAL_TWIST ((digitmode & DSP_DIGITMODE_RELAXDTMF) ? 39.8 : 6.3) /* 8dB sph 12.3 was 6.3 PIKA*/
    #define DTMF_REVERSE_TWIST ((digitmode & DSP_DIGITMODE_RELAXDTMF) ? 39.8 : 2.5) /* 4dB normal sph 12.5 : 5.5 was 6.5 : 2.5 PIKA*/
    #define DTMF_RELATIVE_PEAK_ROW ((digitmode & DSP_DIGITMODE_RELAXDTMF) ? 1.0 : 6.3) /* 8dB sph was 6.3 PIKA*/
    #define DTMF_RELATIVE_PEAK_COL ((digitmode & DSP_DIGITMODE_RELAXDTMF) ? 1.0 : 6.3) /* 8dB sph was 6.3 PIKA*/
    #define DTMF_TO_TOTAL_ENERGY ((digitmode & DSP_DIGITMODE_RELAXDTMF) ? 22.0 : 42.0) /* PIKA */
    #else
    #define DTMF_NORMAL_TWIST ((digitmode & DSP_DIGITMODE_RELAXDTMF) ? 11.3 : 6.3) /* 8dB sph 12.3 was 6.3 */
    #define DTMF_REVERSE_TWIST ((digitmode & DSP_DIGITMODE_RELAXDTMF) ? 9.5 : 2.5) /* 4dB normal sph 12.5 : 5.5 was 6.5 : 2.5 */
    #define DTMF_RELATIVE_PEAK_ROW ((digitmode & DSP_DIGITMODE_RELAXDTMF) ? 3.3 : 6.3) /* 8dB sph was 6.3 */
    #define DTMF_RELATIVE_PEAK_COL ((digitmode & DSP_DIGITMODE_RELAXDTMF) ? 3.3 : 6.3) /* 8dB sph was 6.3 */
    #define DTMF_TO_TOTAL_ENERGY ((digitmode & DSP_DIGITMODE_RELAXDTMF) ? 26.0 : 42.0)
    #endif //GSM_TWEAKS PIKA
    #else
    #define DTMF_NORMAL_TWIST 6.3
    #define DTMF_REVERSE_TWIST ((digitmode & DSP_DIGITMODE_RELAXDTMF) ? 4.0 : 2.5) /* 4dB normal */
    #define DTMF_RELATIVE_PEAK_ROW 6.3 /* 8dB */
    #define DTMF_RELATIVE_PEAK_COL 6.3 /* 8dB */
    #define DTMF_TO_TOTAL_ENERGY 42.0
    #endif

    7) create the asterisk-gsm.patch by invoking the diff command
    # diff -Naur ./asterisk-1.4.x_orig/main ./asterisk-1.4.x/main asterisk-gsm.patch

    8) Copy the asterisk.patch and asterisk-gsm.patch files to <PADS_dir>/package/asterisk
    9) Update asterisk.mk file to the Asterisk version you require updated.
    ASTERISK_VERSION=1.4.x

    10) Build PADS
    11) If there is an error with the Patch, then you will need to fix the .patch file and replace the orinal file to test again

    If you need to update to asterisk 1.4.31, here are the patch files that should work ftp://ftp.pikatech.com/outgoing/pads...isk_1_4_31.tgz.
    Last edited by agauthier; 05-20-10 at 02:41 PM.

  2. #2
    Join Date
    Jul 2008
    Posts
    268

    Default

    I tried this procedure but it looks like there are problems with the 'astmanproxy' package.

  3. #3
    alaing Guest

    Default

    The fix in astmanproxy is
    astmanproxy/src/include/astmanproxy.h

    Make the following change:

    Change "#define RETRYINTERVAL 2" to "#define RETRYINTERVAL 4" and recompile astmanproxy (and then recreate images, etc).

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •