<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi,</div><div><br></div>If you want to manually add the P-Asserted-Identity header, you must first set sip_cid_type to none. Or you could just set effective_caller_id_number to the number that should show up in PAI.<div><div><div><br><div apple-content-edited="true"> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><span class="Apple-style-span" style="font-size: 12px; "><div>Mathieu Rene</div><div>Avant-Garde Solutions Inc</div><div>Office: + 1 (514) 664-1044 x100</div><div>Cell: +1 (514) 664-1044 x200</div><div><a href="mailto:mrene@avgs.ca">mrene@avgs.ca</a></div><div><br></div><div><br></div></span></div></div></span><br class="Apple-interchange-newline"> </div><br><div><div>On 13-Mar-10, at 3:38 PM, Roland Hänel wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><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'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'm stuck because my provider requires me to send a 'P-Asserted-Identity' 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 'From' 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 = "02222222";</span></font></div> <div><font face="Verdana" size="2"><span class="641453307-12032010"> $session->answer();</span></font></div> <div><font face="Verdana" size="2"><span class="641453307-12032010"> $session->setVariable("effective_caller_id_name", "The Redirector");<br> $session->setVariable("sip_h_P-Asserted-Identity", '<<a href="mailto:sip%3A0123456789@q-loud.net">sip:0123456789@q-loud.net</a>>');</span></font></div> <div><font face="Verdana" size="2"><span class="641453307-12032010"> $session->execute("bridge", "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 <a href="sip:02222222@x.x.x.x">sip:02222222@x.x.x.x</a> SIP/2.0<br>Via: SIP/2.0/UDP x.x.x.x:5080;rport;branch=z9hG4bKca3KS0cQj121N<br>Max-Forwards: 63<br>From: "The Redirector" <<a href="mailto:sip%3A01111111@q-loud.net">sip:01111111@q-loud.net</a>>;tag=DBSvZ9NZc750g<br>To: <<a href="sip:02222222@x.x.x.x">sip:02222222@x.x.x.x</a>><br>Call-ID: ecc19564-a84d-122d-5aa2-00515343ab02<br>CSeq: 128071597 INVITE<br>Contact: <<a href="sip:gw+mygateway@x.x.x.x:5080;transport=udp;gw=mygateway">sip:gw+mygateway@x.x.x.x:5080;transport=udp;gw=mygateway</a>><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: "The Redirector" <<a href="mailto:sip%3A01111111@q-loud.net">sip:01111111@q-loud.net</a>><br>P-Asserted-Identity: <<a href="mailto:sip%3A0123456789@q-loud.net">sip:0123456789@q-loud.net</a>></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 & b-leg From:)<br> 02222222 - the number redirected to (b-leg To:)<br> 0123456789 - the number my provider needs in P-Asserted-Identity ('redirector's number')</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> _______________________________________________<br>FreeSWITCH-users mailing list<br><a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>http://lists.freeswitch.org/mailman/listinfo/freeswitch-users<br>UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users<br>http://www.freeswitch.org<br></blockquote></div><br></div></div></div></body></html>