<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Hello,</p>
    <p><br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 17.04.17 08:38, Narayan P wrote:<br>
    </div>
    <blockquote
cite="mid:HK2PR0201MB17457956E1094C7269B2CA9FD7060@HK2PR0201MB1745.apcprd02.prod.outlook.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <meta name="Generator" content="Microsoft Exchange Server">
      <!-- converted from text -->
      <style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
      <meta content="text/html; charset=UTF-8">
      <style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
      <div dir="ltr">
        <div id="x_divtagdefaultwrapper" dir="ltr"
          style="font-size:12pt; color:#000000;
          font-family:Calibri,Arial,Helvetica,sans-serif">
          <p>Hi Daniel,</p>
          <p><br>
          </p>
          <p>I am attaching here my sip trace at client side.Request you
            to see this.</p>
          <p>My client IP in register request is <span>125.16.231.74
              and the server on which kamailio is running is
              185.122.205.178.</span></p>
          <p><span><br>
            </span></p>
          <p><span>I want my contact header to be <span><a class="moz-txt-link-rfc2396E" href="sip:OTT919620649614@185.122.205.178:5070;lr"><sip:OTT919620649614@185.122.205.178:5070;lr></a></span></span></p>
          <p><span><span><br>
              </span></span></p>
          <p><span><span>I am using avp_subst() function to replace
                this.But kamailio is not starting.</span></span></p>
        </div>
      </div>
    </blockquote>
    <br>
    If kamailio is not starting, then there is something wrong in the
    config.<br>
    <br>
    Can you look in the syslog (/var/log/syslog or /var/log/messages)
    and see what error messages are printed there?<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <blockquote
cite="mid:HK2PR0201MB17457956E1094C7269B2CA9FD7060@HK2PR0201MB1745.apcprd02.prod.outlook.com"
      type="cite">
      <div dir="ltr">
        <div id="x_divtagdefaultwrapper" dir="ltr"
          style="font-size:12pt; color:#000000;
          font-family:Calibri,Arial,Helvetica,sans-serif">
          <p><span><span>Please reply if I am in wrong way or have
                different understanding as I am very new to kamailio.</span></span></p>
          <p><span><span><br>
              </span></span></p>
          <p><span><span>Thanks,</span></span></p>
          <p><span><span>Narayan<br>
              </span></span></p>
          <p><span><span><br>
              </span></span></p>
          <p><span><span></span></span><br>
          </p>
        </div>
        <hr tabindex="-1" style="display:inline-block; width:98%">
        <div id="x_divRplyFwdMsg" dir="ltr"><font style="font-size:11pt"
            color="#000000" face="Calibri, sans-serif"><b>From:</b>
            Narayan P<br>
            <b>Sent:</b> Friday, April 14, 2017 12:54:25 PM<br>
            <b>To:</b> <a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
            <b>Cc:</b> <a class="moz-txt-link-abbreviated" href="mailto:moconda@gmail.com">moconda@gmail.com</a><br>
            <b>Subject:</b> RE: Not able to replace route_uri in contact
            header uri</font>
          <div> </div>
        </div>
      </div>
      <font size="2"><span style="font-size:10pt;">
          <div class="PlainText">Hi Daniel,<br>
            <br>
            Thanks for your response.<br>
            <br>
            I mean to say,<br>
            In my register request the route header i.e. route_uri is
            <a class="moz-txt-link-rfc2396E" href="sip:185.122.205.178"><sip:185.122.205.178></a> and contact header is
            <a class="moz-txt-link-abbreviated" href="mailto:3333@172.22.13.41">3333@172.22.13.41</a>.<br>
            I want my contact header to be <a class="moz-txt-link-abbreviated" href="mailto:3333@185.122.205.178">3333@185.122.205.178</a>.<br>
            So how can I replace the contact header's only domain part
            with route_uri.the user part of the contact header remains
            same.<br>
            <br>
            <br>
            Thanks,<br>
            Narayan<br>
            ________________________________________<br>
            From: Narayan P<br>
            Sent: Thursday, April 13, 2017 11:13 AM<br>
            To: <a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
            Subject: Re: Not able to replace route_uri in contact header
            uri<br>
            <br>
            Hi ,<br>
            <br>
            Can anybody help me how to replace the domain part of
            $route-uri in contact  header .<br>
            <br>
            I am using avp_subst().But kamailio is not starting.<br>
            <br>
            <br>
            I am new to kamailio.Any help will be highly appreciated.<br>
            <br>
            <br>
            Thanks,<br>
            <br>
            Narayan<br>
            <br>
            ________________________________<br>
            From: Narayan P<br>
            Sent: Wednesday, April 12, 2017 8:17:02 AM<br>
            To: <a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
            Subject: Not able to replace route_uri in contact header uri<br>
            <br>
            <br>
            Hi All,<br>
            <br>
            I am using pjsip client and kamailiio,both running on
            different servers.I want to replace the uri on which pjsip
            is running with the uri on which kamailio is running in
            contact header.<br>
            I put some logs on route[REGISTRAR] and able to see the
            $route_uri as kamailio server uri($avp(s:fs) and 
            $hdr(Contact) as pjsip server uri ($avp(s:contact).But I am
            not able to replace the uri with avp_subst() function.<br>
            <br>
            Can anybody help me how to replace the uri or with any any
            other function.<br>
            <br>
            Below I have put the snippet of config file.<br>
            <br>
            <br>
            # Handle SIP registrations<br>
            route[REGISTRAR] {<br>
                    if (!is_method("REGISTER")) return;<br>
            <br>
                    if(isflagset(FLT_NATS)) {<br>
                            setbflag(FLB_NATB);<br>
            #!ifdef WITH_NATSIPPING<br>
                            # do SIP NAT pinging<br>
                            setbflag(FLB_NATSIPPING);<br>
            #!endif<br>
                    }<br>
                    xlog("Narayan: before sending contact\n");<br>
                    $avp(s:contact) = $hdr(Contact);<br>
                    $avp(s:fs) = $route_uri;<br>
                    xlog("Narayan: Forced socket is $avp(s:fs)\n");<br>
                    xlog("Narayan: contact header is
            $avp(s:contact)\n");<br>
                    avp_subst("$avp(s:contact)/avp(s:contac)/g",
            <a class="moz-txt-link-rfc2396E" href="mailto:/(.*)@(.*)/$route_uri/">"/(.*)@(.*)/$route_uri/"</a>);<br>
                    #avp_pushto("$ru/domain","$fd");<br>
                    #rewritehostport("185.122.206.62:5060");<br>
                    t_on_reply("MANAGE_REPLY");<br>
                    t_relay();<br>
                    #if (!save("location")) {<br>
                    #       sl_reply_error();<br>
                    #}<br>
                    exit;<br>
            }<br>
            <br>
            <br>
            Any suggestion will be highly appreciated.<br>
            <br>
            <br>
            Thanks,<br>
            Narayan<br>
            <br>
            <br>
          </div>
        </span></font>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - May 22-24 (USA) - <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
Kamailio World Conference - May 8-10, 2017 - <a class="moz-txt-link-abbreviated" href="http://www.kamailioworld.com">www.kamailioworld.com</a></pre>
  </body>
</html>