Hi All, I am wondering if there is a way to store the user contact info into avp, relay it to existing Regitrar and store the original contact info into location through a function(which i dont know) once i received successful reply from my sip registrar.
Thanks in advance
Regards Asim Riaz
El Lunes, 25 de Agosto de 2008, Asim Riaz escribió:
Hi All, I am wondering if there is a way to store the user contact info into avp, relay it to existing Regitrar and store the original contact info into location through a function(which i dont know) once i received successful reply from my sip registrar.
Sure, save $ct (the Contact URI) in an AVP and process on_reply_route for the outbound REGISTER so in case the reply is 200 you can store the AVP content in database and so.
Hi Baz, I dont know much about avp, could you explain me or give an example howto store information in the avp then save once i received the reply 200. what i am doing at the moment
t_on_reply("2"); fix_nated_register(); avp_write("$from/username","$avp(i:678)"); subst('/^Contact:.*sip:(.*)@(.*)/Contact:<sip:$avp(i:678)@ipaddress of openser>/ig');
onreply_route[2] { if(status=="200") { route(6); } route[6]{ save_noreply("location"); exit;
its works but I am loosing some of the original contact information, as I am saving the reply.
Thanks Asim Riaz
On Mon, Aug 25, 2008 at 7:06 PM, Iñaki Baz Castillo ibc@aliax.net wrote:
El Lunes, 25 de Agosto de 2008, Asim Riaz escribió:
Hi All, I am wondering if there is a way to store the user contact info into
avp,
relay it to existing Regitrar and store the original contact info into location through a function(which i dont know) once i received
successful
reply from my sip registrar.
Sure, save $ct (the Contact URI) in an AVP and process on_reply_route for the outbound REGISTER so in case the reply is 200 you can store the AVP content in database and so.
-- Iñaki Baz Castillo
Users mailing list Users@lists.kamailio.org http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
El Tuesday 26 August 2008 00:27:28 Asim Riaz escribió:
Hi Baz, I dont know much about avp, could you explain me or give an example howto store information in the avp then save once i received the reply 200.
First use: modparam("tm", "onreply_avp_mode", 1) http://www.kamailio.org/docs/modules/1.3.x/tm.html#AEN313
This allows an AVP keeping its value during on_reply_route processing.
To store the AVP just do the following during the REGISTER process:
$avp(i:678)=$fU;
And read that AVP during the on_reply_route.
Iñaki Baz Castillo schrieb:
El Tuesday 26 August 2008 00:27:28 Asim Riaz escribió:
Hi Baz, I dont know much about avp, could you explain me or give an example howto store information in the avp then save once i received the reply 200.
First use: modparam("tm", "onreply_avp_mode", 1) http://www.kamailio.org/docs/modules/1.3.x/tm.html#AEN313
This allows an AVP keeping its value during on_reply_route processing.
To store the AVP just do the following during the REGISTER process:
$avp(i:678)=$fU;
And read that AVP during the on_reply_route.
I think the problem is in the reply_route: How to save this AVP as contact?
regards klaus
El Tuesday 26 August 2008 10:43:43 Klaus Darilion escribió:
I think the problem is in the reply_route: How to save this AVP as contact?
Maybe I didn't understand well the purpose. Does he want to replace the "Contact" in the 200 OK with the content of the stored AVP?
Iñaki Baz Castillo schrieb:
El Tuesday 26 August 2008 10:43:43 Klaus Darilion escribió:
I think the problem is in the reply_route: How to save this AVP as contact?
Maybe I didn't understand well the purpose. Does he want to replace the "Contact" in the 200 OK with the content of the stored AVP?
I think so (for registration only)
El Tuesday 26 August 2008 11:20:24 Klaus Darilion escribió:
Iñaki Baz Castillo schrieb:
El Tuesday 26 August 2008 10:43:43 Klaus Darilion escribió:
I think the problem is in the reply_route: How to save this AVP as contact?
Maybe I didn't understand well the purpose. Does he want to replace the "Contact" in the 200 OK with the content of the stored AVP?
I think so (for registration only)
Well, but note he is doing the following in the request processing instead of in the reply:
subst('/^Contact:.*sip:(.*)@(.*)/Contact:<sip:$avp(i:678)@ipaddress of openser>/ig');
¿?
Iñaki Baz Castillo schrieb:
El Tuesday 26 August 2008 11:20:24 Klaus Darilion escribió:
Iñaki Baz Castillo schrieb:
El Tuesday 26 August 2008 10:43:43 Klaus Darilion escribió:
I think the problem is in the reply_route: How to save this AVP as contact?
Maybe I didn't understand well the purpose. Does he want to replace the "Contact" in the 200 OK with the content of the stored AVP?
I think so (for registration only)
Well, but note he is doing the following in the request processing instead of in the reply:
subst('/^Contact:.*sip:(.*)@(.*)/Contact:<sip:$avp(i:678)@ipaddress of openser>/ig');
Obviously he is trying to build some kind of outboundproxy.
Asim - can't you use the "Path" feature instead? Is the main proxy also Kamailio?
regards klaus
Hi Klaus, main proxy is not Kamailio, Path feature ? its true I can use save function on reply route.
Regards Asim Riaz
On Tue, Aug 26, 2008 at 11:13 AM, Klaus Darilion < klaus.mailinglists@pernau.at> wrote:
Iñaki Baz Castillo schrieb:
El Tuesday 26 August 2008 11:20:24 Klaus Darilion escribió:
Iñaki Baz Castillo schrieb:
El Tuesday 26 August 2008 10:43:43 Klaus Darilion escribió:
I think the problem is in the reply_route: How to save this AVP as contact?
Maybe I didn't understand well the purpose. Does he want to replace the "Contact" in the 200 OK with the content of the stored AVP?
I think so (for registration only)
Well, but note he is doing the following in the request processing
instead of
in the reply:
subst('/^Contact:.*sip:(.*)@(.*)/Contact:<sip:$avp(i:678)@ipaddress
of
openser>/ig');
Obviously he is trying to build some kind of outboundproxy.
Asim - can't you use the "Path" feature instead? Is the main proxy also Kamailio?
regards klaus
Users mailing list Users@lists.kamailio.org http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
El Tuesday 26 August 2008 17:05:47 Asim Riaz escribió:
Hi Klaus, main proxy is not Kamailio, Path feature ?
http://tools.ietf.org/html/rfc3327 http://www.kamailio.org/docs/modules/1.3.x/path.html
its true I can use save function on reply route.
Does it solve your problem then?
sorry my appology I wanted to say I cant use save funtion in reply route.
Regards Asim Riaz
On Tue, Aug 26, 2008 at 4:08 PM, Iñaki Baz Castillo ibc@in.ilimit.eswrote:
El Tuesday 26 August 2008 17:05:47 Asim Riaz escribió:
Hi Klaus, main proxy is not Kamailio, Path feature ?
http://tools.ietf.org/html/rfc3327 http://www.kamailio.org/docs/modules/1.3.x/path.html
its true I can use save function on reply route.
Does it solve your problem then?
-- Iñaki Baz Castillo ibc@in.ilimit.es
Users mailing list Users@lists.kamailio.org http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
I think these is definitely something for a feature request:
Make a generic save_noreply() function which takes AoR and contacts, received socket, clients public IP:port, expires ...... as parameter and works in every route type
regards klaus
Asim Riaz schrieb:
sorry my appology I wanted to say I cant use save funtion in reply route.
Regards Asim Riaz
On Tue, Aug 26, 2008 at 4:08 PM, Iñaki Baz Castillo <ibc@in.ilimit.es mailto:ibc@in.ilimit.es> wrote:
El Tuesday 26 August 2008 17:05:47 Asim Riaz escribió: > Hi Klaus, > main proxy is not Kamailio, Path feature ? http://tools.ietf.org/html/rfc3327 http://www.kamailio.org/docs/modules/1.3.x/path.html > its true I can use save function on reply route. Does it solve your problem then? -- Iñaki Baz Castillo ibc@in.ilimit.es <mailto:ibc@in.ilimit.es> _______________________________________________ Users mailing list Users@lists.kamailio.org <mailto:Users@lists.kamailio.org> http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
Users mailing list Users@lists.kamailio.org http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
I'm actually interested in similar behavior.
I believe I saw a thread on this topic before, but I haven't been able to locate it.
One of the problems is that you can only use the save() registrar function from the request route.
I wish to save the information after the registrar have accepted the registration.
From: users-bounces@lists.kamailio.org [mailto:users-bounces@lists.kamailio.org] On Behalf Of Asim Riaz Sent: Monday, August 25, 2008 1:48 PM To: users@lists.kamailio.org Subject: [Kamailio-Users] AVP to store user contact information
Hi All, I am wondering if there is a way to store the user contact info into avp, relay it to existing Regitrar and store the original contact info into location through a function(which i dont know) once i received successful reply from my sip registrar.
Thanks in advance
Regards Asim Riaz
Vadim Berezniker schrieb:
I’m actually interested in similar behavior.
I believe I saw a thread on this topic before, but I haven’t been able to locate it.
One of the problems is that you can only use the save() registrar function from the request route.
I wish to save the information after the registrar have accepted the registration.
Can't you use the "path" feature?
klaus
*From:* users-bounces@lists.kamailio.org [mailto:users-bounces@lists.kamailio.org] *On Behalf Of *Asim Riaz *Sent:* Monday, August 25, 2008 1:48 PM *To:* users@lists.kamailio.org *Subject:* [Kamailio-Users] AVP to store user contact information
Hi All, I am wondering if there is a way to store the user contact info into avp, relay it to existing Regitrar and store the original contact info into location through a function(which i dont know) once i received successful reply from my sip registrar.
Thanks in advance
Regards Asim Riaz
Users mailing list Users@lists.kamailio.org http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
I don't believe it would help in my case as I need it for a different purpose.
Problem is you can't always share registration between PBXs. For example Asterisk doesn't support it. So if you want to reach a UA on a PBX where it's not registered, one possibility is to route the call through kamailio which knows where all the UAs are. I realize that's it's a limitation of the PBXs, but this is something that could certainly be addressed in kamailio until PBXs catch up.
Of course you do not want to store the information until an OK is received for the registration. Also the expiration in the OK might be different in the OK than in the initial REGISTER. This is not possible right now because you can only use save() on the initial register, not on the successful reply.
If there are better ways to do this, I'm happy to learn. I know there are many things I do not know.
-----Original Message----- From: Klaus Darilion [mailto:klaus.mailinglists@pernau.at] Sent: Tuesday, August 26, 2008 7:54 AM To: Vadim Berezniker Cc: users@lists.kamailio.org Subject: Re: [Kamailio-Users] AVP to store user contact information
Vadim Berezniker schrieb:
I'm actually interested in similar behavior.
I believe I saw a thread on this topic before, but I haven't been able
to locate it.
One of the problems is that you can only use the save() registrar function from the request route.
I wish to save the information after the registrar have accepted the registration.
Can't you use the "path" feature?
klaus
Path feature would solve this issue, but it requires that the main proxy/registrar supports Path too and unfortunately Asterisk does not support it.
Conclusion: there is currently no way to implement the contact rewriting and saving in the reply route with Openser
klaus
Vadim Berezniker schrieb:
I don't believe it would help in my case as I need it for a different purpose.
Problem is you can't always share registration between PBXs. For example Asterisk doesn't support it. So if you want to reach a UA on a PBX where it's not registered, one possibility is to route the call through kamailio which knows where all the UAs are. I realize that's it's a limitation of the PBXs, but this is something that could certainly be addressed in kamailio until PBXs catch up.
Of course you do not want to store the information until an OK is received for the registration. Also the expiration in the OK might be different in the OK than in the initial REGISTER. This is not possible right now because you can only use save() on the initial register, not on the successful reply.
If there are better ways to do this, I'm happy to learn. I know there are many things I do not know.
-----Original Message----- From: Klaus Darilion [mailto:klaus.mailinglists@pernau.at] Sent: Tuesday, August 26, 2008 7:54 AM To: Vadim Berezniker Cc: users@lists.kamailio.org Subject: Re: [Kamailio-Users] AVP to store user contact information
Vadim Berezniker schrieb:
I'm actually interested in similar behavior.
I believe I saw a thread on this topic before, but I haven't been able
to locate it.
One of the problems is that you can only use the save() registrar function from the request route.
I wish to save the information after the registrar have accepted the registration.
Can't you use the "path" feature?
klaus
but I am doing on my existing configuration, i am rewriting the contact information and saving it once i received 200 ok, this is true that the registration time is not the same as I received in first register message. what i am trying to do is to hold all the contact info in AVP and then save the AVP into location once I received the 200 reply here is the script i am using; it does work but I want to do it through AVPs f (method=="REGISTER") { route(2); exit; } route[2] { t_on_reply("2"); fix_nated_register(); force_rport(); avp_write("$from/username","$avp(i:678)");
subst('/^Contact:.*sip:(.*)@(.*)/Contact:<sip:$avp(i:678)kamailio_ip@
/ig');
add_rcv_param(); t_relay("udp:my_registrar_ip:5060");
route[6] { save_noreply("location"); exit; }
onreply_route[2] { if(status=="200") { route(6); }
PM, Klaus Darilion klaus.mailinglists@pernau.at wrote:
Path feature would solve this issue, but it requires that the main proxy/registrar supports Path too and unfortunately Asterisk does not support it.
Conclusion: there is currently no way to implement the contact rewriting and saving in the reply route with Openser
klaus
Vadim Berezniker schrieb:
I don't believe it would help in my case as I need it for a different purpose.
Problem is you can't always share registration between PBXs. For example Asterisk doesn't support it. So if you want to reach a UA on a PBX where it's not registered, one possibility is to route the call through kamailio which knows where all the UAs are. I realize that's it's a limitation of the PBXs, but this is something that could certainly be addressed in kamailio until PBXs catch up.
Of course you do not want to store the information until an OK is received for the registration. Also the expiration in the OK might be different in the OK than in the initial REGISTER. This is not possible right now because you can only use save() on the initial register, not on the successful reply.
If there are better ways to do this, I'm happy to learn. I know there are many things I do not know.
-----Original Message----- From: Klaus Darilion [mailto:klaus.mailinglists@pernau.at] Sent: Tuesday, August 26, 2008 7:54 AM To: Vadim Berezniker Cc: users@lists.kamailio.org Subject: Re: [Kamailio-Users] AVP to store user contact information
Vadim Berezniker schrieb:
I'm actually interested in similar behavior.
I believe I saw a thread on this topic before, but I haven't been able
to locate it.
One of the problems is that you can only use the save() registrar function from the request route.
I wish to save the information after the registrar have accepted the registration.
Can't you use the "path" feature?
klaus
Users mailing list Users@lists.kamailio.org http://lists.kamailio.org/cgi-bin/mailman/listinfo/users