[Freeswitch-users] Trouble with P-Asserted-Identity header(s)

Roland Hänel roland at haenel.me
Sat Mar 13 12:38:26 PST 2010


 Hello,

I'm developing a very simple call-through application using FreeSWITCH, but
currently
I'm stuck because my provider requires me to send a 'P-Asserted-Identity'
header
for outgoing calls if I want so signal an arbitrary caller ID in the 'From'
field.

Setup is as follows:
   - a-leg comes in from an external gateway
   - dialplan dispatches the call to a perl handler script
   - perl script looks like this (simplified as much as possible for this
description):

            $num = "02222222";
            $session->answer();
            $session->setVariable("effective_caller_id_name", "The
Redirector");
            $session->setVariable("sip_h_P-Asserted-Identity", '<
sip:0123456789 at q-loud.net <sip%3A0123456789 at q-loud.net>>');
            $session->execute("bridge", "sofia/gateway/mygateway/$num);

The problem is now that FreeSWITCH correctly insertes a P-Asserted-Identity
header as
set in the perl script. But there is already an existing P-Asserted-Identity
header by default,
so I end up with two of them. This is the outgoing INVITE (b-leg):


INVITE sip:02222222 at x.x.x.x SIP/2.0
Via: SIP/2.0/UDP x.x.x.x:5080;rport;branch=z9hG4bKca3KS0cQj121N
Max-Forwards: 63
From: "The Redirector" <sip:01111111 at q-loud.net <sip%3A01111111 at q-loud.net>
>;tag=DBSvZ9NZc750g
To: <sip:02222222 at x.x.x.x>
Call-ID: ecc19564-a84d-122d-5aa2-00515343ab02
CSeq: 128071597 INVITE
Contact: <sip:gw+mygateway at x.x.x.x:5080;transport=udp;gw=mygateway>
User-Agent: FreeSWITCH-mod_sofia/1.0.trunk-16952M
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, UPDATE, INFO, REGISTER,
REFER, NOTIFY
Supported: timer, precondition, path, replaces
Allow-Events: talk, refer
Privacy: none
Content-Type: application/sdp
Content-Disposition: session
Content-Length: 244
X-Port: 5060
X-FS-Support: update_display
P-Asserted-Identity: "The Redirector"
<sip:01111111 at q-loud.net<sip%3A01111111 at q-loud.net>
>
P-Asserted-Identity: <sip:0123456789 at q-loud.net<sip%3A0123456789 at q-loud.net>
>

[... sdp ...]

Numbers are:

    01111111       - the original caller (a-leg & b-leg From:)
    02222222       - the number redirected to (b-leg To:)
    0123456789    - the number my provider needs in P-Asserted-Identity
('redirector's number')

So, the INVITE is correct, it includes my P-Asserted-Identity 0123456789
line, but unfortunately it already includes another P-Asserted-Identity
011111111
line, and that breaks the setup at my provider.

I really appreciate any help.

Greetings,
Roland

--
Roland Haenel
QSC AG - http://www.qsc.de
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20100313/2f8ff2c7/attachment-0002.html 


More information about the FreeSWITCH-users mailing list