[asterisk-dev] LibPRI: How to add an IE to an outgoing call?

Alexandre Cavalcante Alencar alexandre.alencar at gmail.com
Sat Apr 18 09:12:52 CDT 2009


Hi Michel,

On Sat, Apr 18, 2009 at 10:20 AM, michael ricordeau
<michael.ricordeau at gmail.com> wrote:
> Hello,
>
> if you want to send custom ie in an outgoing call, check :
>
> int q931_setup(struct pri *pri, q931_call *c, struct pri_sr *req)
>
> and static int setup_ies[]
>
> in q931.c  .
>

I added the reverse charging indication IE to setup_ies[] struct

> To be set correctly you must declare your custom ie in
>
> static struct ie ies[]    ( Array of struct ie  in q931.c )  :
>
> your custom ie would be set like this :
>
> {1, Q931_REVERSE_CHARGE_INDIC, "Reverse charge indicator",
> dump__reverse_indicator, receive_reverse_indicator,
> transmit_reverse_indicator },
>

I just added the functions for dump, receive and transmit
(dump_reverse_charge_indic, receive_reverse_charge_indic,
transmit_reverse_charge_indic) to existing declaration.

> (for descriptions of values, see struct ie  in q931.c)
>
> and set functions :
>
> static FUNC_DUMP(dump_reverse_indicator)
>

done

> static FUNC_RECV(receive_reverse_indicator)
>

done

> static FUNC_SEND(transmit_reverse_indicator)
>

done
>
>

But I still with problems with this... here is the code I canged from
libpri 1.4.9

http://201.57.179.27/~alexandre.alencar/q931.c
http://201.57.179.27/~alexandre.alencar/pri_q931.h
http://201.57.179.27/~alexandre.alencar/pri_internal.h
http://201.57.179.27/~alexandre.alencar/libpri.h

If you can take a look and give me some light what I am missing... I
will appreciate.

>
> On Fri, Apr 17, 2009 at 10:49 PM, Alexandre Cavalcante Alencar
> <alexandre.alencar at gmail.com> wrote:
>> Hi Guys,
>>
>> I am trying to enable chan_dahdi.c to selectively block ISDN reverse
>> charging calls (collect calls). This kind of call get identified by
>> the IE 74 (0x4A) when it arrives set with a new call.
>>
>> I made some code to identify it and block the call as needed, but I
>> need to make collect calls (add IE 74 to outgoing calls) to test the
>> code as I am using a loop between two spans to test it.
>>
>> The code I am trying to use for adding the IE 74 is here at
>> pastebin.ca alongside with it's generated log of one call
>>
>> http://www.pastebin.ca/1395196
>>
>> If someone here knows LibPRI and ISDN and can help me get this
>> working, I will appreciate. I don't have much experience with LibPRI
>> and ISDN protocol internals, and I need this hack so I can test the
>> code to block the collect calls, since I don't have a telco ISDN link
>> available.
>>
>> A 'patch' to block all collect calls (not flexible)
>> http://bugs.digium.com/view.php?id=13760
>>
>> References of people asking for this feature
>> http://lists.digium.com/pipermail/asterisk-dev/2004-November/007500.html
>> http://lists.digium.com/pipermail/asterisk-users/2005-July/109268.html
>> http://lists.digium.com/pipermail/asterisk-users/2007-October/198692.html
>>
>> Regards,
>>
>> --
>> Alexandre C Alencar (Skarmeth)
>> http://blog.alexandrealencar.net/
>> http://www.alexandrealencar.net/
>> http://people.debian-ce.org/skarmeth/
>>
>> --
>> Alexandre C Alencar (Skarmeth)
>> http://blog.alexandrealencar.net/
>> http://www.alexandrealencar.net/
>> http://people.debian-ce.org/skarmeth/
>>
>> _______________________________________________
>> --Bandwidth and Colocation Provided by http://www.api-digital.com--
>>
>> asterisk-dev mailing list
>> To UNSUBSCRIBE or update options visit:
>>   http://lists.digium.com/mailman/listinfo/asterisk-dev
>>
>
> _______________________________________________
> --Bandwidth and Colocation Provided by http://www.api-digital.com--
>
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-dev
>



-- 
Alexandre C Alencar (Skarmeth)
http://blog.alexandrealencar.net/
http://www.alexandrealencar.net/
http://people.debian-ce.org/skarmeth/



More information about the asterisk-dev mailing list