<div dir="ltr"><div class="gmail_extra">Hi,</div><div class="gmail_extra"><br></div><div class="gmail_extra">i'm using freeswitch / php esl to make some tests against a sip system.</div><div class="gmail_extra"><br></div><div class="gmail_extra">when using the deflect api, the Referred-By Header is always just the ip of freeswitch server and i expected to be the contact of the gateway i'm using as endpoint.</div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra">   ------------------------------------------------------------------------</div><div class="gmail_extra">send 747 bytes to udp/[10.0.0.4]:5060 at 17:05:21.010061:</div><div class="gmail_extra">   ------------------------------------------------------------------------</div><div class="gmail_extra">   REFER <a href="http://sip:mod_sofia@10.0.0.7:11000">sip:mod_sofia@10.0.0.7:11000</a> SIP/2.0</div><div class="gmail_extra">   Via: SIP/2.0/UDP 10.0.0.18;rport;branch=z9hG4bKej34QSpeaBS2p</div><div class="gmail_extra">   Route: <sip:10.0.0.4;r2=on;lr=on;ftag=FXajgSNDr2Kgj></div><div class="gmail_extra">   Route: <sip:10.0.0.4:7000;r2=on;lr=on;ftag=FXajgSNDr2Kgj></div><div class="gmail_extra">   Max-Forwards: 70</div><div class="gmail_extra">   From: <sip:ParkingTestCase_2@3lHj.admin>;tag=08BXDaFZgp2vQ</div><div class="gmail_extra">   To: "Internal ParkingTestCase DV 3" <sip:0000@3lHj.admin>;tag=FXajgSNDr2Kgj</div><div class="gmail_extra">   Call-ID: eb606910-de48-4545-85bb-8f00d2253a34</div><div class="gmail_extra">   CSeq: 117681896 REFER</div><div class="gmail_extra">   Contact: <sip:ParkingTestCase_2@10.0.0.18:5060;transport=udp></div><div class="gmail_extra">   User-Agent: Testing</div><div class="gmail_extra">   Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE</div><div class="gmail_extra">   Supported: path, replaces</div><div class="gmail_extra">   Refer-To: <sip:*3101@kamailio></div><div class="gmail_extra">   <b>Referred-By: <sip:10.0.0.18></b></div><div class="gmail_extra">   Content-Length: 0</div><div><br></div></div><div class="gmail_extra"><br></div><div class="gmail_extra">following the code, it ends in mod_sofia sending calling the nua_refer.</div><div class="gmail_extra">however, i don't see anywhere in the code where tech_pvt->contact_url is initialized/used</div><div class="gmail_extra">i set the sip_h_referred-by value before calling the deflect and was expecting it would be used, but the code below explicitly sets the header. my problem is that i can't find anywhere where its initialized/used/updated so a second pair of eyes is much appreciated.</div><div class="gmail_extra"><br></div><div class="gmail_extra">thanks</div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra"><span style="white-space:pre">   </span>switch (msg->message_id) {</div><div class="gmail_extra"><br></div><div class="gmail_extra"><span style="white-space:pre">    </span>case SWITCH_MESSAGE_INDICATE_DEFLECT: {</div><div class="gmail_extra"><br></div><div class="gmail_extra"><span style="white-space:pre">          </span>char *extra_headers = sofia_glue_get_extra_headers(channel, SOFIA_SIP_HEADER_PREFIX);</div><div class="gmail_extra"><span style="white-space:pre">           </span>char ref_to[1024] = "";</div><div class="gmail_extra"><span style="white-space:pre">               </span>const char *var;</div><div class="gmail_extra"><br></div><div class="gmail_extra"><span style="white-space:pre">         </span>if (!strcasecmp(msg->string_arg, "sip:")) {</div><div class="gmail_extra"><span style="white-space:pre">                        </span>const char *format = strchr(tech_pvt->profile->sipip, ':') ? "sip:%s@[%s]" : "sip:%s@%s";</div><div class="gmail_extra"><br></div><div class="gmail_extra"><span style="white-space:pre">                      </span>switch_snprintf(ref_to, sizeof(ref_to), format, msg->string_arg, tech_pvt->profile->sipip);</div><div class="gmail_extra"><span style="white-space:pre">            </span>} else {</div><div class="gmail_extra"><span style="white-space:pre">                        </span>switch_set_string(ref_to, msg->string_arg);</div><div class="gmail_extra"><span style="white-space:pre">          </span>}</div><div class="gmail_extra"><br></div><div class="gmail_extra"><span style="white-space:pre">                </span>nua_refer(tech_pvt->nh, SIPTAG_REFER_TO_STR(ref_to), SIPTAG_REFERRED_BY_STR(tech_pvt->contact_url),</div><div class="gmail_extra"><span style="white-space:pre">                               </span>  TAG_IF(!zstr(extra_headers), SIPTAG_HEADER_STR(extra_headers)),</div><div class="gmail_extra"><span style="white-space:pre">                              </span>  TAG_END());</div><div><br></div><div><br></div></div></div>