[pjsip] via header and TLS on a Freeswitch PBX

Benny Prijono bennylp at teluu.com
Mon Aug 24 16:38:01 EDT 2009


Please see the discussion in
http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/2009-August/008473.html

On Mon, Aug 24, 2009 at 8:57 PM, Pierre-Luc
Bacon<pierre-luc.bacon at savoirfairelinux.com> wrote:
> I did the following changes and it worked:
>
> sflphone-common/libs/pjproject-1.4/pjsip/src/pjsip/sip_transport_tls_ossl.c -
> index 4d04b13..d9ea199 100644
> @@ -959,7 +959,7 @@ PJ_DEF(pj_status_t)
> pjsip_tls_transport_start( pjsip_endpoint *endpt,
>     listener = PJ_POOL_ZALLOC_T(pool, struct tls_listener);
>     listener->factory.pool = pool;
>     listener->factory.type = PJSIP_TRANSPORT_TLS;
> -    listener->factory.type_name = "tls";
> +    listener->factory.type_name = "TLS";
>     listener->factory.flag =
>        pjsip_transport_get_flag_from_type(PJSIP_TRANSPORT_TLS);
>     listener->sock = PJ_INVALID_SOCKET;
> @@ -1270,7 +1270,7 @@ static pj_status_t tls_create( struct tls_listener
> *listener,
>
>     tls->base.key.type = PJSIP_TRANSPORT_TLS;
>     pj_memcpy(&tls->base.key.rem_addr, remote, sizeof(pj_sockaddr_in));
> -    tls->base.type_name = "tls";
> +    tls->base.type_name = "TLS";
>     tls->base.flag =
> pjsip_transport_get_flag_from_type(PJSIP_TRANSPORT_TLS);
>
>     tls->base.info = (char*) pj_pool_alloc(pool, 64);
>
> On Mon, 2009-08-24 at 14:33 -0400, Pierre-Luc Bacon wrote:
>> Which commit/ticket is that ? I can't find it in the
>> svn log.
>>
>> Thanks,
>> Pierre-Luc Bacon
>>
>> On Mon, 2009-08-24 at 16:43 +0100, Benny Prijono wrote:
>> > Pierre,
>> >
>> > this was fixed in the trunk just few days ago. We will now send in uppercase.
>> >
>> > Cheers
>> >  Benny
>> >
>> > On Mon, Aug 24, 2009 at 4:36 PM, Pierre-Luc
>> > Bacon<pierre-luc.bacon at savoirfairelinux.com> wrote:
>> > > I am implementing TLS transport from the PJSIP library and ran over a
>> > > via header problem while trying to register to Freeswitch server.
>> > >
>> > > >From the debug output on the freeswitch box I see:
>> > > "nta: Via check: invalid transport "SIP/2.0/tls" from
>> > > 192.168.1.12:37842"
>> > >
>> > > Where 192.168.1.12 is from the the softphone that is implementing
>> > > PJSIP.
>> > >
>> > > Digging into the freeswitch source code, I saw that this message was
>> > > coming from
>> > >
>> > > libs/sofia-sip/libsofia-sip-ua/nta/nta.c
>> > >
>> > > where they do "[...]!su_strmatch(v->v_protocol, tpv->v_protocol)", and
>> > > su_strmatch is a wrapper over strcmp.
>> > >
>> > > It turns out that "SIP/2.0/tls" (pjsip) is compared with
>> > > "SIP/2.0/TLS" (sofia) and strcmp being case sensitive, the match fails.
>> > >
>> > >
>> > > I tried to look in RFC3261 to see what was said about that but I
>> > > couldn't find it exactly. I'm pretty sure that PJSIP is doing it right
>> > > and that the via header should be processed in a case-insensitive way.
>> > >
>> > >
>> > > _______________________________________________
>> > > Visit our blog: http://blog.pjsip.org
>> > >
>> > > pjsip mailing list
>> > > pjsip at lists.pjsip.org
>> > > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>> > >
>>
>>
>> _______________________________________________
>> Visit our blog: http://blog.pjsip.org
>>
>> pjsip mailing list
>> pjsip at lists.pjsip.org
>> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>
>




More information about the pjsip mailing list