<div dir="ltr"><div><div>You can send the info you need to Asterisk using X headers, for example:<br><br></div><div>Kamailio has the pseudo variable $si which contains the public IP originating the request and you can send that to Asterisk using append_hf.<br></div><div><br></div>  append_hf("X-orig-IP: $si");<br><br><br></div>In Asterisk you can access the headers as ${SIP_HEADER(X-orig-IP)}<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Dec 27, 2014 at 7:00 PM, Cibin Paul <span dir="ltr"><<a href="mailto:paul_cibin@me.com" target="_blank">paul_cibin@me.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hey,  thanks for looking into this. Phones register with kamailio and I have configured kamailio to load balance the asterisk servers using round robin algorithm. Phones registered in kamailio will directly send the call to the asterisk servers. From there I will send the call out using other routes.<br>
<br>
In the contact field of the sip header, I get the username@private ip instead of the public ip. I need it in the format username@public ip<br>
<div class="HOEnZb"><div class="h5"><br>
> On 27-Dec-2014, at 3:26 pm, Daniel-Constantin Mierla <<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>> wrote:<br>
><br>
> Hello,<br>
><br>
> I am not that familiar with asterisk to know all the insides SIPURI and<br>
> SIPCHANNEL(recvip), you have to explain which fields you need from the<br>
> SIP packet in order to be able to assist further, unless someone else<br>
> more familiar with asterisk can jump in.<br>
><br>
> Also, it is not clear how the flow is there, you say you have kamailio<br>
> behind asterisk servers, does that mean the phone is sending to asterisk<br>
> first, which then forwards to kamailio?<br>
><br>
> Cheers,<br>
> Daniel<br>
><br>
>> On 26/12/14 18:37, Cibin Paul wrote:<br>
>> Hi,<br>
>><br>
>> I have a kamailio 4.1 as a gateway  and registrar behind asterisk servers. On asterisk, I save the IP address of the originating call parsing the SIPURI or SIPCHANNEL(recvip). In both cases, I am receiving the private ip of the user agent registered with kamailio. Do I need to change anything in kamailio to receive the actual IP address. Please suggest.<br>
>><br>
>> Regards<br>
>> Cibin<br>
>><br>
>><br>
>> _______________________________________________<br>
>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
>> <a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
>> <a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
><br>
> --<br>
> Daniel-Constantin Mierla<br>
> <a href="http://twitter.com/#!/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a><br>
><br>
><br>
> _______________________________________________<br>
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
> <a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
> <a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br>
_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</div></div></blockquote></div><br></div>