Index: funcs/func_channel.c =================================================================== --- funcs/func_channel.c (revision 274530) +++ funcs/func_channel.c (working copy) @@ -228,6 +228,12 @@ + + R/O Get the span related to this DAHDI channel. + + + R/O Get the PRI channel related to this DAHDI channel. + Index: channels/chan_dahdi.c =================================================================== --- channels/chan_dahdi.c (revision 274530) +++ channels/chan_dahdi.c (working copy) @@ -46,6 +46,7 @@ openr2 ***/ + #include "asterisk.h" ASTERISK_FILE_VERSION(__FILE__, "$Revision$") @@ -6564,6 +6565,14 @@ break; } ast_mutex_unlock(&p->lock); + } else if (!strcasecmp(data, "pri_span")) { + ast_mutex_lock(&p->lock); + snprintf(buf, len, "%d", p->span); + ast_mutex_unlock(&p->lock); + } else if (!strcasecmp(data, "pri_channel")) { + ast_mutex_lock(&p->lock); + snprintf(buf, len, "%d", p->channel); + ast_mutex_unlock(&p->lock); #endif /* defined(HAVE_PRI) */ } else { *buf = '\0'; @@ -9137,6 +9146,8 @@ pbx_builtin_setvar_helper(tmp, "MFCR2_CATEGORY", openr2_proto_get_category_string(i->mfcr2_recvd_category)); } #endif + + if (ast_pbx_start(tmp)) { ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmp->name); ast_hangup(tmp);