<div><font face="Verdana" size="2">
<div><font face="Verdana" size="2"><span class="641453307-12032010">Hello,</span></font></div>
<div><font face="Verdana" size="2"><span class="641453307-12032010"></span></font> </div>
<div><font face="Verdana" size="2"><span class="641453307-12032010">I&#39;m developing a 
very simple call-through application using FreeSWITCH, but 
currently</span></font></div>
<div><font face="Verdana" size="2"><span class="641453307-12032010">I&#39;m stuck because 
my provider requires me to send a &#39;P-Asserted-Identity&#39; 
header</span></font></div>
<div><font face="Verdana" size="2"><span class="641453307-12032010">for outgoing calls 
if I want so signal an arbitrary caller ID in the &#39;From&#39; 
field.</span></font></div>
<div><font face="Verdana" size="2"><span class="641453307-12032010"></span></font> </div>
<div><font face="Verdana" size="2"><span class="641453307-12032010">Setup is as 
follows:</span></font></div>
<div><font face="Verdana" size="2"><span class="641453307-12032010">   - a-leg comes 
in from an external gateway</span></font></div>
<div><font face="Verdana" size="2"><span class="641453307-12032010">   - dialplan 
dispatches the call to a perl handler script</span></font></div>
<div><font face="Verdana" size="2"><span class="641453307-12032010">   - perl script 
looks like this (simplified as much as possible for this 
description):</span></font></div>
<div><font face="Verdana" size="2"><span class="641453307-12032010"></span></font> </div>
<div><font face="Verdana" size="2"><span class="641453307-12032010">            $num = 
&quot;02222222&quot;;</span></font></div>
<div><font face="Verdana" size="2"><span class="641453307-12032010">            
$session-&gt;answer();</span></font></div>
<div><font face="Verdana" size="2"><span class="641453307-12032010">            
$session-&gt;setVariable(&quot;effective_caller_id_name&quot;, &quot;The 
Redirector&quot;);<br>            
$session-&gt;setVariable(&quot;sip_h_P-Asserted-Identity&quot;, 
&#39;&lt;<a href="mailto:sip%3A0123456789@q-loud.net">sip:0123456789@q-loud.net</a>&gt;&#39;);</span></font></div>
<div><font face="Verdana" size="2"><span class="641453307-12032010">            
$session-&gt;execute(&quot;bridge&quot;, 
&quot;sofia/gateway/mygateway/$num);<br><br></span></font></div>
<div><font face="Verdana" size="2"><span class="641453307-12032010">The problem is now 
that FreeSWITCH correctly insertes a P-Asserted-Identity header 
as</span></font></div>
<div><font face="Verdana" size="2"><span class="641453307-12032010">set in the perl 
script. But there is already an existing P-Asserted-Identity header by 
default,</span></font></div>
<div><font face="Verdana" size="2"><span class="641453307-12032010">so I end up with 
two of them. This is the outgoing INVITE (b-leg):</span></font></div>
<div><font face="Verdana" size="2"><span class="641453307-12032010"></span></font> </div>
<blockquote dir="ltr" style="margin-right: 0px;">
<div><font face="Verdana" size="2"><span class="641453307-12032010">INVITE 
sip:02222222@x.x.x.x SIP/2.0<br>Via: SIP/2.0/UDP 
x.x.x.x:5080;rport;branch=z9hG4bKca3KS0cQj121N<br>Max-Forwards: 63<br>From: &quot;The 
Redirector&quot; &lt;<a href="mailto:sip%3A01111111@q-loud.net">sip:01111111@q-loud.net</a>&gt;;tag=DBSvZ9NZc750g<br>To: 
&lt;sip:02222222@x.x.x.x&gt;<br>Call-ID: 
ecc19564-a84d-122d-5aa2-00515343ab02<br>CSeq: 128071597 INVITE<br>Contact: 
&lt;sip:gw+mygateway@x.x.x.x:5080;transport=udp;gw=mygateway&gt;<br>User-Agent: 
FreeSWITCH-mod_sofia/1.0.trunk-16952M<br>Allow: INVITE, ACK, BYE, CANCEL, 
OPTIONS, MESSAGE, UPDATE, INFO, REGISTER, REFER, NOTIFY<br>Supported: timer, 
precondition, path, replaces<br>Allow-Events: talk, refer<br>Privacy: 
none<br>Content-Type: application/sdp<br>Content-Disposition: 
session<br>Content-Length: 244<br>X-Port: 5060<br>X-FS-Support: 
update_display<br>P-Asserted-Identity: &quot;The Redirector&quot; 
&lt;<a href="mailto:sip%3A01111111@q-loud.net">sip:01111111@q-loud.net</a>&gt;<br>P-Asserted-Identity: 
&lt;<a href="mailto:sip%3A0123456789@q-loud.net">sip:0123456789@q-loud.net</a>&gt;</span></font></div>
<div> </div>
<div><font face="Verdana" size="2"><span class="641453307-12032010">[... sdp 
...]</span></font></div></blockquote>
<p class="Section1"><span style="font-size: 10pt; font-family: Verdana;"><span class="641453307-12032010">Numbers are:</span></span></p>
<p class="Section1"><span style="font-size: 10pt; font-family: Verdana;"><span class="641453307-12032010">    01111111       - the original caller (a-leg &amp; 
b-leg From:)<br>    02222222       - the number redirected to (b-leg To:)<br>    
0123456789    - the number my provider needs in P-Asserted-Identity 
(&#39;redirector&#39;s number&#39;)</span></span></p>
<p class="Section1"><span style="font-size: 10pt; font-family: Verdana;"><span class="641453307-12032010">So, the INVITE is correct, it includes my 
P-Asserted-Identity 0123456789<br>line, but unfortunately it already includes 
another P-Asserted-Identity 011111111<br>line, and that breaks the setup at my 
provider.</span></span></p>
<p class="Section1"><span style="font-size: 10pt; font-family: Verdana;"><span class="641453307-12032010">I really appreciate any help.</span></span></p>
<p class="Section1"><span style="font-size: 10pt; font-family: Verdana;"><span class="641453307-12032010">Greetings,<br>Roland</span></span></p>
<p class="Section1"><span style="font-size: 10pt; font-family: Verdana;"><span class="641453307-12032010">--<br>Roland Haenel<br>QSC AG - <a title="http://www.qsc.de/" href="http://www.qsc.de/">http://www.qsc.de</a></span></span></p>
</font></div>
<div> </div>