[SR-Users] flag f in search_hf() is not working for me
Daniel-Constantin Mierla
miconda at gmail.com
Tue Apr 7 12:37:43 CEST 2015
Hello,
thanks for reporting and troubleshooting. I pushed the fix to master and
4.2 branches.
Cheers,
Daniel
On 07/04/15 12:22, schwatzi at web.de wrote:
> Hi.
>
> I think there is a bug in function search_hf_f() in textops.c
>
> Here is what I do
>
> if ( method == SUBSCRIBE ) {
> if ( !search_hf("Event", "call-completion", "f") ) {
> sl_send_reply("489","Bad Event");
> exit;
> }
> }
>
> But here is a SUBSCRIBE that do pass the proxy.
>
>
> SUBSCRIBE sip:101 at 192.168.1.50 SIP/2.0
> Via: SIP/2.0/UDP
> 77.10.66.72:59793;branch=z9hG4bKPj.O5IXVtDsImPNfCGnDkvj91INsEfvZsm
> Max-Forwards: 70
> From: <sip:101 at 192.168.1.50>;tag=8-cXkrmwx5WGSIAYgYaXW0oTTsEAEM1S
> To: <sip:101 at 192.168.1.50>
> Contact: <sip:101 at 192.168.1.8:59793;ob>
> Call-ID: O12dPIx7Wiih2b.o36UFmMdXr6RE-8Jl
> CSeq: 24359 SUBSCRIBE
> Route: <sip:192.168.1.50;transport=udp;lr>
> Event: message-summary
> Expires: 3600
> Supported: replaces, 100rel, timer, norefersub
> Accept: application/simple-message-summary
> Allow-Events: presence, message-summary, refer
> User-Agent: CSipSimple_mako-21/r2457
> Content-Length: 0
>
>
> As you can see the Event header doesn't contain "call-completition".
>
>
> Looking at function search_hf_f() i saw that if nothing is found
> value -1 will be returned. if there is the match then 1 is returned.
> (see line 2779 and 2797)
> But in line 2782 the function will return 1 instead of -1
>
>
> index 50a6f07..a945937 100644
> --- a/modules/textops/textops.c
> +++ b/modules/textops/textops.c
> @@ -2779,7 +2779,7 @@ static int search_hf_f(struct sip_msg* msg,
> char* str_hf, char* re, char *flags)
> return 1;
> } else {
> if(flags!=NULL && *flags=='f')
> - return 1;
> + return -1;
> }
> } else {
> hfl = hf;
>
>
> I am no programmer so it's possible that I misunderstood something.
>
>
> greetz
> Paolo
>
>
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
--
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio World Conference, May 27-29, 2015
Berlin, Germany - http://www.kamailioworld.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20150407/52c878f7/attachment.html>
More information about the sr-users
mailing list