Skip to content

Commit

Permalink
Merge pull request #294 from tallicamike/feature-sipmsgvalidate-for-t…
Browse files Browse the repository at this point in the history
…ofrom

sipmsgops: Additional "f", "t" and "c" flags for sipmsg_validate() which check To, From and Contact header integrity
  • Loading branch information
liviuchircu committed Aug 22, 2014
2 parents e2f1969 + e4b080f commit ab7f422
Show file tree
Hide file tree
Showing 3 changed files with 323 additions and 186 deletions.
10 changes: 10 additions & 0 deletions modules/sipmsgops/README
Expand Up @@ -516,6 +516,11 @@ add_body("Hello World!", "text/plain");
* 'm' - don't check the Max-Forwards header.
* 'r' - checks the R-URI and whether the domain contains
valid characters.
* 'f' - checks the URI of the 'From' field and whether the
domain contains valid characters.
* 't' - checks the URI of the 'To' field and whether the
domain contains valid characters.
* 'c' - checks the URI of the 'Contact' field.

The result_pvar parameter sets resulting pvar with text error
reason in case of negative result ( easy for logging or
Expand Down Expand Up @@ -547,6 +552,11 @@ add_body("Hello World!", "text/plain");
* -19 - No Unsupported header in 420 reply.
* -20 - No WWW-Authorize header in 401 reply.
* -21 - No Content-Type header
* -22 - To header parse error
* -23 - From header parse error
* -24 - Bad hostname in To header
* -25 - Bad hostname in From header
* -26 - Contact header parse error
* -255 - undefined errors.

This function can be used from REQUEST_ROUTE, ONREPLY_ROUTE,
Expand Down
18 changes: 18 additions & 0 deletions modules/sipmsgops/doc/sipmsgops_admin.xml
Expand Up @@ -722,6 +722,14 @@ add_body("Hello World!", "text/plain");
<listitem><para><emphasis>'r'</emphasis> - checks the R-URI
and whether the domain contains valid characters.
</para></listitem>
<listitem><para><emphasis>'f'</emphasis> - checks the URI of the 'From' field
and whether the domain contains valid characters.
</para></listitem>
<listitem><para><emphasis>'t'</emphasis> - checks the URI of the 'To' field
and whether the domain contains valid characters.
</para></listitem>
<listitem><para><emphasis>'c'</emphasis> - checks the URI of the 'Contact' field.
</para></listitem>
</itemizedlist>
</para>
<para>The result_pvar parameter sets resulting pvar with text error reason in case of
Expand Down Expand Up @@ -775,6 +783,16 @@ add_body("Hello World!", "text/plain");
</para></listitem>
<listitem><para><emphasis>-21</emphasis> - No Content-Type header
</para></listitem>
<listitem><para><emphasis>-22</emphasis> - To header parse error
</para></listitem>
<listitem><para><emphasis>-23</emphasis> - From header parse error
</para></listitem>
<listitem><para><emphasis>-24</emphasis> - Bad hostname in To header
</para></listitem>
<listitem><para><emphasis>-25</emphasis> - Bad hostname in From header
</para></listitem>
<listitem><para><emphasis>-26</emphasis> - Contact header parse error
</para></listitem>
<listitem><para><emphasis>-255</emphasis> - undefined errors.
</para></listitem>
</itemizedlist>
Expand Down

0 comments on commit ab7f422

Please sign in to comment.