--- channels/chan_dahdi.c (revision 130633) +++ channels/chan_dahdi.c (working copy) @@ -2360,8 +2360,11 @@ const char *gen_dig_scheme = NULL; const char *gen_name = NULL; const char *jip_digits = NULL; - const char *lspi_ident = NULL; - const char *rlt_flag = NULL; + const char *lspi = NULL; + char lspi_ident[64]; + int lspi_type = 0; + int lspi_scheme = 0; + int lspi_context = 0; const char *call_ref_id = NULL; const char *call_ref_pc = NULL; const char *send_far = NULL; @@ -2451,14 +2454,17 @@ jip_digits = pbx_builtin_getvar_helper(ast, "SS7_JIP"); if (jip_digits) isup_set_jip_digits(p->ss7call, jip_digits); - - lspi_ident = pbx_builtin_getvar_helper(ast, "SS7_LSPI_IDENT"); - if (lspi_ident) - isup_set_lspi(p->ss7call, lspi_ident, 0x18, 0x7, 0x00); - - rlt_flag = pbx_builtin_getvar_helper(ast, "SS7_RLT_ON"); - if ((rlt_flag) && ((strncmp("NO", rlt_flag, strlen(rlt_flag))) != 0 )) { - isup_set_lspi(p->ss7call, rlt_flag, 0x18, 0x7, 0x00); /* Setting for Nortel DMS-250/500 */ + + /* Set 'SS7_LSPI=:::' * + * Set 'SS7_LSPI=0x18:0x7:0x00:' for Nortel DMS-250/500 * + * Set 'SS7_LSPI=NO' not to set lspi */ + lspi = pbx_builtin_getvar_helper(ast, "SS7_LSPI"); + if (lspi && ((strncmp("NO", lspi, strlen(lspi))) != 0 )) { + int res = sscanf(lspi, "%i : %i : %i : %64c", &lspi_type, &lspi_scheme, &lspi_context, lspi_ident); + if ( res == 4 ) { + isup_set_lspi(p->ss7call, (char *)lspi_ident, (unsigned char)lspi_type, + (unsigned char)lspi_scheme, (unsigned char)lspi_context); + } } call_ref_id = pbx_builtin_getvar_helper(ast, "SS7_CALLREF_IDENT"); @@ -9373,7 +9379,8 @@ p->gen_dig_scheme = 0; if (!ast_strlen_zero(p->lspi_ident)) { - pbx_builtin_setvar_helper(c, "SS7_LSPI_IDENT", p->lspi_ident); + snprintf(tmp, sizeof(tmp), "0x%X:0x%X:0x%X:%s", p->lspi_type, p->lspi_scheme, p->lspi_context, p->lspi_ident); + pbx_builtin_setvar_helper(c, "SS7_LSPI", tmp); /* Clear this after we set it */ p->lspi_ident[0] = 0; }