[asterisk-dev] BOUNTY: Implement application MWIMessageSend to call libpri routine

Richard Mudgett rmudgett at digium.com
Thu Feb 10 12:27:07 CST 2011


> call = pri_new_call(pris[span_no - 1].pri.pri); /* obtain cref */
> 
> if (activate > 0) {
> res = pri_mwi_activate(pris[span_no - 1].pri.pri, call,
> orig_number, (PRI_TON_UNKNOWN << 4) | PRI_NPI_E163_E164,
> orig_name, PRES_ALLOWED_NETWORK_NUMBER, dest_number,
> (PRI_TON_UNKNOWN << 4) | PRI_NPI_E163_E164);
> } else {
> res = pri_mwi_deactivate(pris[span_no - 1].pri.pri, call,
> orig_number, (PRI_TON_UNKNOWN << 4) | PRI_NPI_E163_E164,
> orig_name, PRES_ALLOWED_NETWORK_NUMBER, dest_number,
> (PRI_TON_UNKNOWN << 4) | PRI_NPI_E163_E164);
> }
> 
> Although he wasn't able to make it a pure app_x.c with no mods to
> any other module (he had trouble making an app_x.c module link
> properly to a direct call into libpri and we needed the pris[]
> array which is local to chan_dahdi.c so we have some additional
> code, but no modified code, in chan_dahdi.c), I'm paying him the
> full bounty, and he will see Eu364.30 appear in his account as
> soon as he tells me where to send it.

You should be able to include it as part of chan_dahdi.c because
it is dependent upon that module being present and you need access
to internal structures and libpri anyway.  There are already some
applications that are part of chan_dahdi already.  The
DAHDISendCallreroutingFacility application is one.

> Question: did he need to do something to destroy the call created
> with pri_new_call, i.e., do I have a memory leak? I oughta dock
> him about Eu14.30 if that's the case. :-)

You should not need to because the cis_auto_disconnect flag is set
when the call was initiated by the pri_mwi_activate()/pri_mwi_deactivate()
calls.  If you don't call those functions after the pri_new_call() because
of some error then you need to destroy the call with pri_destroycall(). :)

Richard



More information about the asterisk-dev mailing list