[sr-dev] git:master: modules/sipt: finalise $sipt_event_info support

Daniel-Constantin Mierla miconda at gmail.com
Mon Apr 7 12:19:42 CEST 2014


Just as suggestion, if you are going to have many variables prefixed 
with $sipt_, it might be good to shift from $sipt_KEY to $sipt(KEY). The 
new evapi module has a simple example of how to implement 
$xyz(abc)-style of variables.

You can keep exiting format if you like it more, this is just an opinion 
that the other one is giving a better structure and relation with the 
module.

Cheers,
Daniel

On 07/04/14 11:22, Torrey Searle wrote:
> Module: sip-router
> Branch: master
> Commit: a42976948e1b6cabd978c1d61d30cea9cdc27cc2
> URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=a42976948e1b6cabd978c1d61d30cea9cdc27cc2
>
> Author: Torrey Searle <tsearle at gmail.com>
> Committer: Torrey Searle <tsearle at gmail.com>
> Date:   Mon Apr  7 11:18:27 2014 +0200
>
> modules/sipt: finalise $sipt_event_info support
>
> ---
>
>   modules/sipt/README             |   18 ++++++++++++++++++
>   modules/sipt/doc/sipt_admin.xml |   22 ++++++++++++++++++++++
>   modules/sipt/sipt.c             |    2 +-
>   3 files changed, 41 insertions(+), 1 deletions(-)
>
> diff --git a/modules/sipt/README b/modules/sipt/README
> index 36801f6..0866646 100644
> --- a/modules/sipt/README
> +++ b/modules/sipt/README
> @@ -27,6 +27,7 @@ Torrey Searle
>                 4.4. $sipt_cpc
>                 4.5. $sipt_calling_party_nai
>                 4.6. $sipt_called_party_nai
> +              4.7. $sipt_event_info
>   
>      List of Tables
>   
> @@ -34,6 +35,7 @@ Torrey Searle
>      1.2. Screening Indicator Values
>      1.3. Calling Nature of Address Values
>      1.4. Called Nature of Address Values
> +   1.5. Event Info Values
>   
>      List of Examples
>   
> @@ -65,6 +67,7 @@ Chapter 1. Admin Guide
>           4.4. $sipt_cpc
>           4.5. $sipt_calling_party_nai
>           4.6. $sipt_called_party_nai
> +        4.7. $sipt_event_info
>   
>   1. Overview
>   
> @@ -121,6 +124,7 @@ sipt_set_calling($fU, 4, 0, 3);
>      4.4. $sipt_cpc
>      4.5. $sipt_calling_party_nai
>      4.6. $sipt_called_party_nai
> +   4.7. $sipt_event_info
>   
>   4.1. $sipt_presentation
>   
> @@ -244,3 +248,17 @@ if($sipt_called_party_nai == 3)
>   }
>   
>   ...
> +
> +4.7. $sipt_event_info
> +
> +   Returns the value of the Event Info header of the CPG message. Returns
> +   -1 if there is a parsing error.
> +
> +   Table 1.5. Event Info Values
> +   0 Spare
> +   1 ALERTING
> +   2 PROGRESS
> +   3 In-band information or an appropriate pattern is now available
> +   4 Call forward on busy
> +   5 Call forward on no reply
> +   6 Call forward unconditional
> diff --git a/modules/sipt/doc/sipt_admin.xml b/modules/sipt/doc/sipt_admin.xml
> index 9c33e8c..35f6034 100644
> --- a/modules/sipt/doc/sipt_admin.xml
> +++ b/modules/sipt/doc/sipt_admin.xml
> @@ -251,6 +251,28 @@ if($sipt_called_party_nai == 3)
>   </programlisting>
>   		</example>
>   	</section>
> +	<section id="sipt.v.sipt_event_info">
> +		<title><varname>$sipt_event_info</varname></title>
> +		<para>
> +			Returns the value of the Event Info header
> +			of the CPG message.
> +			Returns -1 if there is a parsing error.
> +		</para>
> +		<table>
> +			<title>Event Info Values</title>
> +			<tgroup cols="2">
> +				<tbody>
> +					<row><entry>0</entry><entry>Spare</entry></row>
> +					<row><entry>1</entry><entry>ALERTING</entry></row>
> +					<row><entry>2</entry><entry>PROGRESS</entry></row>
> +					<row><entry>3</entry><entry>In-band information or an appropriate pattern is now available</entry></row>
> +					<row><entry>4</entry><entry>Call forward on busy</entry></row>
> +					<row><entry>5</entry><entry>Call forward on no reply</entry></row>
> +					<row><entry>6</entry><entry>Call forward unconditional</entry></row>
> +				</tbody>
> +			</tgroup>
> +		</table>
> +	</section>
>   
>   </section>
>   </chapter>
> diff --git a/modules/sipt/sipt.c b/modules/sipt/sipt.c
> index 5a979c0..56c9fc6 100644
> --- a/modules/sipt/sipt.c
> +++ b/modules/sipt/sipt.c
> @@ -104,7 +104,7 @@ static pv_export_t mod_items[] = {
>                   0, 0, 0, 0 },
>           { {"sipt_hop_counter",  sizeof("sipt_hop_counter")-1}, PVT_OTHER,  sipt_get_hop_counter,    0,
>                   0, 0, 0, 0 },
> -        { {"sipt_event_info",  sizeof("sipt_cpc")-1}, PVT_OTHER,  sipt_get_event_info,    0,
> +        { {"sipt_event_info",  sizeof("sipt_event_info")-1}, PVT_OTHER,  sipt_get_event_info,    0,
>                   0, 0, 0, 0 },
>           { {"sipt_cpc",  sizeof("sipt_cpc")-1}, PVT_OTHER,  sipt_get_cpc,    0,
>                   0, 0, 0, 0 },
>
>
> _______________________________________________
> sr-dev mailing list
> sr-dev at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

-- 
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio World Conference - April 2-4, 2014, Berlin, Germany
http://www.kamailioworld.com




More information about the sr-dev mailing list