Hi all,
I need to parse the header field Referred-By, can any one tell me. How can I do this? For example, which files I must to edit because the SER-0.9.0 can NOT parse this header field.
Thanks in advance,
Ing. Francisco Talavera
Dpto. Investigación y Desarrollo
Conexión S.A.
I need send to other Process the Referred_By header field in the Invite Method. How can I do this?
I read the Parser (parser/hf.h) directory but it can not parse this header field.
Thanks in advance.
Francisco Talavera
-----Mensaje original----- De: Andreas Granig [mailto:andreas.granig@inode.info] Enviado el: miércoles, 19 de octubre de 2005 14:46 Para: Ing. Francisco Talavera CC: 'SER Users' Asunto: Re: [Serusers] RV: [Serdev] Parse Referred-By
Ing. Francisco Talavera wrote:
I need to parse the header field Referred-By, can any one
tell me. How can I do this? For example, which files I must to edit because the SER-0.9.0 can NOT parse this header field.
What exactly do you want to achieve?
Andy
Ing. Francisco Talavera wrote:
I need send to other Process the Referred_By header field in the Invite Method. How can I do this?
I read the Parser (parser/hf.h) directory but it can not parse this header field.
You only need to parse the header field if you want to load parts of it into avp or use them in other code parts of SER. In newer versions of SER (don't know exactly from which version upwards) you can also load the content of the header into avp using the avpops module.
If you just want to pass it to a script called by exec_dset() or exec_msg(), you can access any header field using the environment variable SIP_HF_<header-name>.
So I'm not sure if it's really needed to touch the parser unless you tell us how exactly you plan to use it.
Andy
Andy:
I was write a module "MyModule" in SER, It communicates with other program (MyProgram) via Socket. This Module (MyModule) need to send the Referred-By header field to MyProgram. Thats my problem.
The communication between MyModule and MyProgram is XML message, I need to parse the Referred header field and encapsulate in XML message.
I now SER have a function "parse_headers()", with this function I parse the call-id header field... like this.. parse_headers(msg, (int) HDR_CALLID, 0)
But I can NOT do this ... parse_headers(msg, (int) HDR_REFERRED_BY, 0)... because HDR_REFERRED_BY doesnt exist..
Now I think it was more clearly.
Thank in advance Francisco Talavera
-----Mensaje original----- De: serusers-bounces@iptel.org [mailto:serusers-bounces@lists.iptel.org] En nombre de Andreas Granig Enviado el: miércoles, 19 de octubre de 2005 16:02 Para: Ing. Francisco Talavera CC: 'SER Users' Asunto: Re: [Serusers] RV: [Serdev] Parse Referred-By
Ing. Francisco Talavera wrote:
I need send to other Process the Referred_By header field in the Invite Method. How can I do this?
I read the Parser (parser/hf.h) directory but it can not parse this header field.
You only need to parse the header field if you want to load parts of it into avp or use them in other code parts of SER. In newer versions of SER (don't know exactly from which version upwards) you can also load the content of the header into avp using the avpops module.
If you just want to pass it to a script called by exec_dset() or exec_msg(), you can access any header field using the environment variable SIP_HF_<header-name>.
So I'm not sure if it's really needed to touch the parser unless you tell us how exactly you plan to use it.
Andy
_______________________________________________ Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Hi!
I would try to write the referred-by URI into an AVP using avp_write. Then, in your module, you can read this AVP and send it to YourProgramm.
Take a look at the lcr module, expecially the function next_contacts(). Then you will see how to read from AVPs in a module.
regards klaus
Ing. Francisco Talavera wrote:
Andy:
I was write a module "MyModule" in SER, It communicates with other program (MyProgram) via Socket. This Module (MyModule) need to send the Referred-By header field to MyProgram. That’s my problem.
The communication between MyModule and MyProgram is XML message, I need to parse the Referred header field and encapsulate in XML message.
I now SER have a function "parse_headers()", with this function I parse the call-id header field... like this.. parse_headers(msg, (int) HDR_CALLID, 0)
But I can NOT do this ... parse_headers(msg, (int) HDR_REFERRED_BY, 0)... because HDR_REFERRED_BY doesn’t exist..
Now I think it was more clearly.
Thank in advance Francisco Talavera
-----Mensaje original----- De: serusers-bounces@iptel.org [mailto:serusers-bounces@lists.iptel.org] En nombre de Andreas Granig Enviado el: miércoles, 19 de octubre de 2005 16:02 Para: Ing. Francisco Talavera CC: 'SER Users' Asunto: Re: [Serusers] RV: [Serdev] Parse Referred-By
Ing. Francisco Talavera wrote:
I need send to other Process the Referred_By header field in the Invite Method. How can I do this?
I read the Parser (parser/hf.h) directory but it can not parse this header field.
You only need to parse the header field if you want to load parts of it into avp or use them in other code parts of SER. In newer versions of SER (don't know exactly from which version upwards) you can also load the content of the header into avp using the avpops module.
If you just want to pass it to a script called by exec_dset() or exec_msg(), you can access any header field using the environment variable SIP_HF_<header-name>.
So I'm not sure if it's really needed to touch the parser unless you tell us how exactly you plan to use it.
Andy
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Andy:
I use SER-0.9.0, can i use avp_write with this version?.
Regards Francisco
-----Mensaje original----- De: serusers-bounces@iptel.org [mailto:serusers-bounces@lists.iptel.org] En nombre de Klaus Darilion Enviado el: jueves, 20 de octubre de 2005 9:00 Para: Ing. Francisco Talavera CC: 'SER Users' Asunto: Re: [Serusers] RV: [Serdev] Parse Referred-By
Hi!
I would try to write the referred-by URI into an AVP using avp_write. Then, in your module, you can read this AVP and send it to YourProgramm.
Take a look at the lcr module, expecially the function next_contacts(). Then you will see how to read from AVPs in a module.
regards klaus
Ing. Francisco Talavera wrote:
Andy:
I was write a module "MyModule" in SER, It communicates with other program (MyProgram) via Socket. This Module (MyModule) need to send the
Referred-By
header field to MyProgram. Thats my problem.
The communication between MyModule and MyProgram is XML message, I need to parse the Referred header field and encapsulate in XML message.
I now SER have a function "parse_headers()", with this function I parse
the
call-id header field... like this.. parse_headers(msg, (int) HDR_CALLID,
0)
But I can NOT do this ... parse_headers(msg, (int) HDR_REFERRED_BY, 0)... because HDR_REFERRED_BY doesnt exist..
Now I think it was more clearly.
Thank in advance Francisco Talavera
-----Mensaje original----- De: serusers-bounces@iptel.org [mailto:serusers-bounces@lists.iptel.org] En
nombre
de Andreas Granig Enviado el: miércoles, 19 de octubre de 2005 16:02 Para: Ing. Francisco Talavera CC: 'SER Users' Asunto: Re: [Serusers] RV: [Serdev] Parse Referred-By
Ing. Francisco Talavera wrote:
I need send to other Process the Referred_By header field in the Invite Method. How can I do this?
I read the Parser (parser/hf.h) directory but it can not parse this header field.
You only need to parse the header field if you want to load parts of it into avp or use them in other code parts of SER. In newer versions of SER (don't know exactly from which version upwards) you can also load the content of the header into avp using the avpops module.
If you just want to pass it to a script called by exec_dset() or exec_msg(), you can access any header field using the environment variable SIP_HF_<header-name>.
So I'm not sure if it's really needed to touch the parser unless you tell us how exactly you plan to use it.
Andy
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
_______________________________________________ Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Ing. Francisco Talavera wrote:
I use SER-0.9.0, can i use avp_write with this version?.
According to [1] you can, but I haven't ever tested that.
Andy
[1] http://www.voice-system.ro/docs/avpops/0.9.0/ar01s06.html#avp_write
no, not for getting header's bodys. only in head.
bogdan
Ing. Francisco Talavera wrote:
Andy:
I use SER-0.9.0, can i use avp_write with this version?.
Regards Francisco
-----Mensaje original----- De: serusers-bounces@iptel.org [mailto:serusers-bounces@lists.iptel.org] En nombre de Klaus Darilion Enviado el: jueves, 20 de octubre de 2005 9:00 Para: Ing. Francisco Talavera CC: 'SER Users' Asunto: Re: [Serusers] RV: [Serdev] Parse Referred-By
Hi!
I would try to write the referred-by URI into an AVP using avp_write. Then, in your module, you can read this AVP and send it to YourProgramm.
Take a look at the lcr module, expecially the function next_contacts(). Then you will see how to read from AVPs in a module.
regards klaus
Ing. Francisco Talavera wrote:
Andy:
I was write a module "MyModule" in SER, It communicates with other program (MyProgram) via Socket. This Module (MyModule) need to send the
Referred-By
header field to MyProgram. That’s my problem.
The communication between MyModule and MyProgram is XML message, I need to parse the Referred header field and encapsulate in XML message.
I now SER have a function "parse_headers()", with this function I parse
the
call-id header field... like this.. parse_headers(msg, (int) HDR_CALLID,
But I can NOT do this ... parse_headers(msg, (int) HDR_REFERRED_BY, 0)... because HDR_REFERRED_BY doesn’t exist..
Now I think it was more clearly.
Thank in advance Francisco Talavera
-----Mensaje original----- De: serusers-bounces@iptel.org [mailto:serusers-bounces@lists.iptel.org] En
nombre
de Andreas Granig Enviado el: miércoles, 19 de octubre de 2005 16:02 Para: Ing. Francisco Talavera CC: 'SER Users' Asunto: Re: [Serusers] RV: [Serdev] Parse Referred-By
Ing. Francisco Talavera wrote:
I need send to other Process the Referred_By header field in the Invite Method. How can I do this?
I read the Parser (parser/hf.h) directory but it can not parse this header field.
You only need to parse the header field if you want to load parts of it into avp or use them in other code parts of SER. In newer versions of SER (don't know exactly from which version upwards) you can also load the content of the header into avp using the avpops module.
If you just want to pass it to a script called by exec_dset() or exec_msg(), you can access any header field using the environment variable SIP_HF_<header-name>.
So I'm not sure if it's really needed to touch the parser unless you tell us how exactly you plan to use it.
Andy
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Bogdan:
When I have the header field fallowing this: do parse_headers(HDR_EOH) to parse all hdrs and go over the entire hdr list (in msg->headers) and look for hdr with "name" equal to "Referred-By".
How can I parse the body from this header field... in Parse directory we have some function to do that?
Some Ideas..?
Francisco.
-----Mensaje original----- De: Bogdan-Andrei Iancu [mailto:bogdan@voice-system.ro] Enviado el: jueves, 20 de octubre de 2005 11:03 Para: Ing. Francisco Talavera CC: 'Klaus Darilion'; 'SER Users' Asunto: Re: [Serusers] RV: [Serdev] Parse Referred-By
no, not for getting header's bodys. only in head.
bogdan
Ing. Francisco Talavera wrote:
Andy:
I use SER-0.9.0, can i use avp_write with this version?.
Regards Francisco
-----Mensaje original----- De: serusers-bounces@iptel.org [mailto:serusers-bounces@lists.iptel.org] En
nombre
de Klaus Darilion Enviado el: jueves, 20 de octubre de 2005 9:00 Para: Ing. Francisco Talavera CC: 'SER Users' Asunto: Re: [Serusers] RV: [Serdev] Parse Referred-By
Hi!
I would try to write the referred-by URI into an AVP using avp_write. Then, in your module, you can read this AVP and send it to YourProgramm.
Take a look at the lcr module, expecially the function next_contacts(). Then you will see how to read from AVPs in a module.
regards klaus
Ing. Francisco Talavera wrote:
Andy:
I was write a module "MyModule" in SER, It communicates with other program (MyProgram) via Socket. This Module (MyModule) need to send the
Referred-By
header field to MyProgram. Thats my problem.
The communication between MyModule and MyProgram is XML message, I need to parse the Referred header field and encapsulate in XML message.
I now SER have a function "parse_headers()", with this function I parse
the
call-id header field... like this.. parse_headers(msg, (int) HDR_CALLID,
But I can NOT do this ... parse_headers(msg, (int) HDR_REFERRED_BY, 0)... because HDR_REFERRED_BY doesnt exist..
Now I think it was more clearly.
Thank in advance Francisco Talavera
-----Mensaje original----- De: serusers-bounces@iptel.org [mailto:serusers-bounces@lists.iptel.org] En
nombre
de Andreas Granig Enviado el: miércoles, 19 de octubre de 2005 16:02 Para: Ing. Francisco Talavera CC: 'SER Users' Asunto: Re: [Serusers] RV: [Serdev] Parse Referred-By
Ing. Francisco Talavera wrote:
I need send to other Process the Referred_By header field in the Invite Method. How can I do this?
I read the Parser (parser/hf.h) directory but it can not parse this
header
field.
You only need to parse the header field if you want to load parts of it into avp or use them in other code parts of SER. In newer versions of SER (don't know exactly from which version upwards) you can also load the content of the header into avp using the avpops module.
If you just want to pass it to a script called by exec_dset() or exec_msg(), you can access any header field using the environment variable SIP_HF_<header-name>.
So I'm not sure if it's really needed to touch the parser unless you tell us how exactly you plan to use it.
Andy
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Bogdan:
Are you sure that the parse_headers(HDR_EOH) Do not parse the body, because it function calls get_hdr_field()?
Francisco
-----Mensaje original----- De: serusers-bounces@iptel.org [mailto:serusers-bounces@lists.iptel.org] En nombre de Ing. Francisco Talavera Enviado el: jueves, 17 de noviembre de 2005 14:20 Para: 'Bogdan-Andrei Iancu' CC: 'SER Users' Asunto: RE: [Serusers] RV: [Serdev] Parse Referred-By
Bogdan:
When I have the header field fallowing this: do parse_headers(HDR_EOH) to parse all hdrs and go over the entire hdr list (in msg->headers) and look for hdr with "name" equal to "Referred-By".
How can I parse the body from this header field... in Parse directory we have some function to do that?
Some Ideas..?
Francisco.
-----Mensaje original----- De: Bogdan-Andrei Iancu [mailto:bogdan@voice-system.ro] Enviado el: jueves, 20 de octubre de 2005 11:03 Para: Ing. Francisco Talavera CC: 'Klaus Darilion'; 'SER Users' Asunto: Re: [Serusers] RV: [Serdev] Parse Referred-By
no, not for getting header's bodys. only in head.
bogdan
Ing. Francisco Talavera wrote:
Andy:
I use SER-0.9.0, can i use avp_write with this version?.
Regards Francisco
-----Mensaje original----- De: serusers-bounces@iptel.org [mailto:serusers-bounces@lists.iptel.org] En
nombre
de Klaus Darilion Enviado el: jueves, 20 de octubre de 2005 9:00 Para: Ing. Francisco Talavera CC: 'SER Users' Asunto: Re: [Serusers] RV: [Serdev] Parse Referred-By
Hi!
I would try to write the referred-by URI into an AVP using avp_write. Then, in your module, you can read this AVP and send it to YourProgramm.
Take a look at the lcr module, expecially the function next_contacts(). Then you will see how to read from AVPs in a module.
regards klaus
Ing. Francisco Talavera wrote:
Andy:
I was write a module "MyModule" in SER, It communicates with other program (MyProgram) via Socket. This Module (MyModule) need to send the
Referred-By
header field to MyProgram. Thats my problem.
The communication between MyModule and MyProgram is XML message, I need to parse the Referred header field and encapsulate in XML message.
I now SER have a function "parse_headers()", with this function I parse
the
call-id header field... like this.. parse_headers(msg, (int) HDR_CALLID,
But I can NOT do this ... parse_headers(msg, (int) HDR_REFERRED_BY, 0)... because HDR_REFERRED_BY doesnt exist..
Now I think it was more clearly.
Thank in advance Francisco Talavera
-----Mensaje original----- De: serusers-bounces@iptel.org [mailto:serusers-bounces@lists.iptel.org] En
nombre
de Andreas Granig Enviado el: miércoles, 19 de octubre de 2005 16:02 Para: Ing. Francisco Talavera CC: 'SER Users' Asunto: Re: [Serusers] RV: [Serdev] Parse Referred-By
Ing. Francisco Talavera wrote:
I need send to other Process the Referred_By header field in the Invite Method. How can I do this?
I read the Parser (parser/hf.h) directory but it can not parse this
header
field.
You only need to parse the header field if you want to load parts of it into avp or use them in other code parts of SER. In newer versions of SER (don't know exactly from which version upwards) you can also load the content of the header into avp using the avpops module.
If you just want to pass it to a script called by exec_dset() or exec_msg(), you can access any header field using the environment variable SIP_HF_<header-name>.
So I'm not sure if it's really needed to touch the parser unless you tell us how exactly you plan to use it.
Andy
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
_______________________________________________ Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
It will only separate the name of the header field from the body, but it will not parse the body. Header field body is only parsed automatically for selected header fields (To, CSeq, Via, Content-Length). For the rest you will get the beginning of the body and its length and you should parse it explicitly.
Jan.
On 13-10-2005 15:00, Ing. Francisco Talavera wrote:
Bogdan:
Are you sure that the parse_headers(HDR_EOH) Do not parse the body, because it function calls get_hdr_field()?
Francisco
-----Mensaje original----- De: serusers-bounces@iptel.org [mailto:serusers-bounces@lists.iptel.org] En nombre de Ing. Francisco Talavera Enviado el: jueves, 17 de noviembre de 2005 14:20 Para: 'Bogdan-Andrei Iancu' CC: 'SER Users' Asunto: RE: [Serusers] RV: [Serdev] Parse Referred-By
Bogdan:
When I have the header field fallowing this: do parse_headers(HDR_EOH) to parse all hdrs and go over the entire hdr list (in msg->headers) and look for hdr with "name" equal to "Referred-By".
How can I parse the body from this header field... in Parse directory we have some function to do that?
Some Ideas..?
Francisco.
-----Mensaje original----- De: Bogdan-Andrei Iancu [mailto:bogdan@voice-system.ro] Enviado el: jueves, 20 de octubre de 2005 11:03 Para: Ing. Francisco Talavera CC: 'Klaus Darilion'; 'SER Users' Asunto: Re: [Serusers] RV: [Serdev] Parse Referred-By
no, not for getting header's bodys. only in head.
bogdan
Ing. Francisco Talavera wrote:
Andy:
I use SER-0.9.0, can i use avp_write with this version?.
Regards Francisco
-----Mensaje original----- De: serusers-bounces@iptel.org [mailto:serusers-bounces@lists.iptel.org] En
nombre
de Klaus Darilion Enviado el: jueves, 20 de octubre de 2005 9:00 Para: Ing. Francisco Talavera CC: 'SER Users' Asunto: Re: [Serusers] RV: [Serdev] Parse Referred-By
Hi!
I would try to write the referred-by URI into an AVP using avp_write. Then, in your module, you can read this AVP and send it to YourProgramm.
Take a look at the lcr module, expecially the function next_contacts(). Then you will see how to read from AVPs in a module.
regards klaus
Ing. Francisco Talavera wrote:
Andy:
I was write a module "MyModule" in SER, It communicates with other program (MyProgram) via Socket. This Module (MyModule) need to send the
Referred-By
header field to MyProgram. Thats my problem.
The communication between MyModule and MyProgram is XML message, I need to parse the Referred header field and encapsulate in XML message.
I now SER have a function "parse_headers()", with this function I parse
the
call-id header field... like this.. parse_headers(msg, (int) HDR_CALLID,
But I can NOT do this ... parse_headers(msg, (int) HDR_REFERRED_BY, 0)... because HDR_REFERRED_BY doesnt exist..
Now I think it was more clearly.
Thank in advance Francisco Talavera
-----Mensaje original----- De: serusers-bounces@iptel.org [mailto:serusers-bounces@lists.iptel.org] En
nombre
de Andreas Granig Enviado el: miércoles, 19 de octubre de 2005 16:02 Para: Ing. Francisco Talavera CC: 'SER Users' Asunto: Re: [Serusers] RV: [Serdev] Parse Referred-By
Ing. Francisco Talavera wrote:
I need send to other Process the Referred_By header field in the Invite Method. How can I do this?
I read the Parser (parser/hf.h) directory but it can not parse this
header
field.
You only need to parse the header field if you want to load parts of it into avp or use them in other code parts of SER. In newer versions of SER (don't know exactly from which version upwards) you can also load the content of the header into avp using the avpops module.
If you just want to pass it to a script called by exec_dset() or exec_msg(), you can access any header field using the environment variable SIP_HF_<header-name>.
So I'm not sure if it's really needed to touch the parser unless you tell us how exactly you plan to use it.
Andy
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Serdev mailing list serdev@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serdev
Hi All
I am trying to improve my proxy setup to force clients behind the same NAT device to connect each other directly. My setup is fairly complex, (rtpproxy / NAT Helper, PSTN gateways, different peers etc) but it's loosely based on the OnSip.org setup. The current config works correctly for all clients, whether behind a NAT or not, but I'd prefer not to have to use RTP proxy to allow UA's on the same nat to contact each other. I've seen the document from the AVPops module, but I can't get the example to work. I think the problem is WHERE I put the avpops config. As this works on FWD, I think it's possible. Has anyone got this working?
Noel
Noel, If you send the config showing how you do it, it will be easier to comment. :-)
In general, what you should do is this: - Starting from onsip.org configs, there are three locations you need to change: route[4] NAT Traversal, loose route handling and onreply - I suggest creating a new route block where you test the src_ip of the message against the looked up location of ruri/domain, i.e. this only works after a successful lookup("location") has been done. This should be the (untested) code snippet: avp_write("$ruri/domain", "i:624"); if (avp_check("i:624","eq/$src_ip")) { setflag(SAME_NAT); } (NOTE: I'm not sure about how avp_write will handle $ruri/domain as :port is at the end of the domain for ruri after a lookup. You should probably turn on debugging and use avp_print) - Then run the test from the NAT traversal route, as well as the loose route (not in onreply) and check for the flag before doing force_rtp_proxy - In onreply add && !isflagset(SAME_NAT) to the NAT if test
No guarantees... This has not been tested. However, if you can report that it works (or whatever was wrong), I will submit the code piece as a suggestion for the ONsip.org Getting Started document. g-)
----- Original Message ----- From: "Noel Sharpe" noels@radnetwork.co.uk To: "'SER Users'" serusers@lists.iptel.org Sent: Wednesday, November 09, 2005 9:15 PM Subject: [Serusers] UA's behind the same NAT
Hi All
I am trying to improve my proxy setup to force clients behind the same NAT device to connect each other directly. My setup is fairly complex, (rtpproxy / NAT Helper, PSTN gateways, different peers etc) but it's loosely based on the OnSip.org setup. The current config works correctly for all clients, whether behind a NAT or not, but I'd prefer not to have to use RTP proxy to allow UA's on the same nat to contact each other. I've seen the document from the AVPops module, but I can't get the example to work. I think the problem is WHERE I put the avpops config. As this works on FWD, I think it's possible. Has anyone got this working?
Noel
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Hi Noel,
Just a tought, (dont know if your users does this, but just to lighten the aera)
what happens if there is a double NAT here, and you say, that users behind the same nat (atleast with the logic G wrote) they would have the same source-ip and the same ruri ip, but would'nt be on the same physical lan..
see setup : B C NAT-->UA2 A / ser - NAT \ NAT -->UA1 D E
A= Public IP B= NAT1's public IP C= NAT1's Local Subnet D= NAT2's public ip E= NAT2's Local subnet
The from would look like: (ua2) from:blablasip:UA2@C (UA1) from:blublusip:UA1@E
e.request-uri would be : (UA2) sip:ua2@A (UA1) sip:ua1@a
SourceIP for both request's would be A, So, you cant really (by this) know if UA1 and UA2 is behind the same nat, esesially if there is a double, or triple or so...
-Atle
* Greger V. Teigre greger@teigre.com [051110 07:50]:
Noel, If you send the config showing how you do it, it will be easier to comment. :-)
In general, what you should do is this:
- Starting from onsip.org configs, there are three locations you need to
change: route[4] NAT Traversal, loose route handling and onreply
- I suggest creating a new route block where you test the src_ip of the
message against the looked up location of ruri/domain, i.e. this only works after a successful lookup("location") has been done. This should be the (untested) code snippet: avp_write("$ruri/domain", "i:624"); if (avp_check("i:624","eq/$src_ip")) { setflag(SAME_NAT); } (NOTE: I'm not sure about how avp_write will handle $ruri/domain as :port is at the end of the domain for ruri after a lookup. You should probably turn on debugging and use avp_print)
- Then run the test from the NAT traversal route, as well as the loose
route (not in onreply) and check for the flag before doing force_rtp_proxy
- In onreply add && !isflagset(SAME_NAT) to the NAT if test
No guarantees... This has not been tested. However, if you can report that it works (or whatever was wrong), I will submit the code piece as a suggestion for the ONsip.org Getting Started document. g-)
----- Original Message ----- From: "Noel Sharpe" noels@radnetwork.co.uk To: "'SER Users'" serusers@lists.iptel.org Sent: Wednesday, November 09, 2005 9:15 PM Subject: [Serusers] UA's behind the same NAT
Hi All
I am trying to improve my proxy setup to force clients behind the same NAT device to connect each other directly. My setup is fairly complex, (rtpproxy / NAT Helper, PSTN gateways, different peers etc) but it's loosely based on the OnSip.org setup. The current config works correctly for all clients, whether behind a NAT or not, but I'd prefer not to have to use RTP proxy to allow UA's on the same nat to contact each other. I've seen the document from the AVPops module, but I can't get the example to work. I think the problem is WHERE I put the avpops config. As this works on FWD, I think it's possible. Has anyone got this working?
Noel
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Atle, Thanks for pointing this out, I was exhausted ;-) after my long email. We have received requests for this feature at onsip.org a few times. The reason why we haven't added it is exactly the issue you point out. We have at one point talked about adding an Appendix to the Getting Started document called "Suggestions for additions and changes to your ser.cfg" where things like this can be documented separately. People can then add the feature to their configs themselves if they like. g-)
----- Original Message ----- From: "Atle Samuelsen" clona@cyberhouse.no To: "Greger V. Teigre" greger@teigre.com Cc: "Noel Sharpe" noels@radnetwork.co.uk; "'SER Users'" serusers@lists.iptel.org Sent: Thursday, November 10, 2005 8:19 AM Subject: Re: [Serusers] UA's behind the same NAT
Hi Noel,
Just a tought, (dont know if your users does this, but just to lighten the aera)
what happens if there is a double NAT here, and you say, that users behind the same nat (atleast with the logic G wrote) they would have the same source-ip and the same ruri ip, but would'nt be on the same physical lan..
see setup : B C NAT-->UA2 A / ser - NAT \ NAT -->UA1 D E
A= Public IP B= NAT1's public IP C= NAT1's Local Subnet D= NAT2's public ip E= NAT2's Local subnet
The from would look like: (ua2) from:blablasip:UA2@C (UA1) from:blublusip:UA1@E
e.request-uri would be : (UA2) sip:ua2@A (UA1) sip:ua1@a
SourceIP for both request's would be A, So, you cant really (by this) know if UA1 and UA2 is behind the same nat, esesially if there is a double, or triple or so...
-Atle
- Greger V. Teigre greger@teigre.com [051110 07:50]:
Noel, If you send the config showing how you do it, it will be easier to comment. :-)
In general, what you should do is this:
- Starting from onsip.org configs, there are three locations you need to
change: route[4] NAT Traversal, loose route handling and onreply
- I suggest creating a new route block where you test the src_ip of the
message against the looked up location of ruri/domain, i.e. this only works after a successful lookup("location") has been done. This should be the (untested) code snippet: avp_write("$ruri/domain", "i:624"); if (avp_check("i:624","eq/$src_ip")) { setflag(SAME_NAT); } (NOTE: I'm not sure about how avp_write will handle $ruri/domain as :port is at the end of the domain for ruri after a lookup. You should probably turn on debugging and use avp_print)
- Then run the test from the NAT traversal route, as well as the loose
route (not in onreply) and check for the flag before doing force_rtp_proxy
- In onreply add && !isflagset(SAME_NAT) to the NAT if test
No guarantees... This has not been tested. However, if you can report that it works (or whatever was wrong), I will submit the code piece as a suggestion for the ONsip.org Getting Started document. g-)
----- Original Message ----- From: "Noel Sharpe" noels@radnetwork.co.uk To: "'SER Users'" serusers@lists.iptel.org Sent: Wednesday, November 09, 2005 9:15 PM Subject: [Serusers] UA's behind the same NAT
Hi All
I am trying to improve my proxy setup to force clients behind the same NAT device to connect each other directly. My setup is fairly complex, (rtpproxy / NAT Helper, PSTN gateways, different peers etc) but it's loosely based on the OnSip.org setup. The current config works correctly for all clients, whether behind a NAT or not, but I'd prefer not to have to use RTP proxy to allow UA's on the same nat to contact each other. I've seen the document from the AVPops module, but I can't get the example to work. I think the problem is WHERE I put the avpops config. As this works on FWD, I think it's possible. Has anyone got this working?
Noel
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Hi Greger,
I see your idea, nd I like it :-)
-A
* Greger V. Teigre greger@teigre.com [051110 08:36]:
Atle, Thanks for pointing this out, I was exhausted ;-) after my long email. We have received requests for this feature at onsip.org a few times. The reason why we haven't added it is exactly the issue you point out. We have at one point talked about adding an Appendix to the Getting Started document called "Suggestions for additions and changes to your ser.cfg" where things like this can be documented separately. People can then add the feature to their configs themselves if they like. g-)
----- Original Message ----- From: "Atle Samuelsen" clona@cyberhouse.no To: "Greger V. Teigre" greger@teigre.com Cc: "Noel Sharpe" noels@radnetwork.co.uk; "'SER Users'" serusers@lists.iptel.org Sent: Thursday, November 10, 2005 8:19 AM Subject: Re: [Serusers] UA's behind the same NAT
Hi Noel,
Just a tought, (dont know if your users does this, but just to lighten the aera)
what happens if there is a double NAT here, and you say, that users behind the same nat (atleast with the logic G wrote) they would have the same source-ip and the same ruri ip, but would'nt be on the same physical lan..
see setup : B C NAT-->UA2 A / ser - NAT \ NAT -->UA1 D E
A= Public IP B= NAT1's public IP C= NAT1's Local Subnet D= NAT2's public ip E= NAT2's Local subnet
The from would look like: (ua2) from:blablasip:UA2@C (UA1) from:blublusip:UA1@E
e.request-uri would be : (UA2) sip:ua2@A (UA1) sip:ua1@a
SourceIP for both request's would be A, So, you cant really (by this) know if UA1 and UA2 is behind the same nat, esesially if there is a double, or triple or so...
-Atle
- Greger V. Teigre greger@teigre.com [051110 07:50]:
Noel, If you send the config showing how you do it, it will be easier to comment. :-)
In general, what you should do is this:
- Starting from onsip.org configs, there are three locations you need to
change: route[4] NAT Traversal, loose route handling and onreply
- I suggest creating a new route block where you test the src_ip of the
message against the looked up location of ruri/domain, i.e. this only works after a successful lookup("location") has been done. This should be the (untested) code snippet: avp_write("$ruri/domain", "i:624"); if (avp_check("i:624","eq/$src_ip")) { setflag(SAME_NAT); } (NOTE: I'm not sure about how avp_write will handle $ruri/domain as :port is at the end of the domain for ruri after a lookup. You should probably turn on debugging and use avp_print)
- Then run the test from the NAT traversal route, as well as the loose
route (not in onreply) and check for the flag before doing force_rtp_proxy
- In onreply add && !isflagset(SAME_NAT) to the NAT if test
No guarantees... This has not been tested. However, if you can report that it works (or whatever was wrong), I will submit the code piece as a suggestion for the ONsip.org Getting Started document. g-)
----- Original Message ----- From: "Noel Sharpe" noels@radnetwork.co.uk To: "'SER Users'" serusers@lists.iptel.org Sent: Wednesday, November 09, 2005 9:15 PM Subject: [Serusers] UA's behind the same NAT
Hi All
I am trying to improve my proxy setup to force clients behind the same NAT device to connect each other directly. My setup is fairly complex, (rtpproxy / NAT Helper, PSTN gateways, different peers etc) but it's loosely based on the OnSip.org setup. The current config works correctly for all clients, whether behind a NAT or not, but I'd prefer not to have to use RTP proxy to allow UA's on the same nat to contact each other. I've seen the document from the AVPops module, but I can't get the example to work. I think the problem is WHERE I put the avpops config. As this works on FWD, I think it's possible. Has anyone got this working?
Noel
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
do parse_headers(HDR_EOH) to parse all hdrs and go over the entire hdr list (in msg->headers) and look for hdr with "name" equal to "Referred-By".
bogdan
Ing. Francisco Talavera wrote:
Andy:
I was write a module "MyModule" in SER, It communicates with other program (MyProgram) via Socket. This Module (MyModule) need to send the Referred-By header field to MyProgram. That’s my problem.
The communication between MyModule and MyProgram is XML message, I need to parse the Referred header field and encapsulate in XML message.
I now SER have a function "parse_headers()", with this function I parse the call-id header field... like this.. parse_headers(msg, (int) HDR_CALLID, 0)
But I can NOT do this ... parse_headers(msg, (int) HDR_REFERRED_BY, 0)... because HDR_REFERRED_BY doesn’t exist..
Now I think it was more clearly.
Thank in advance Francisco Talavera
-----Mensaje original----- De: serusers-bounces@iptel.org [mailto:serusers-bounces@lists.iptel.org] En nombre de Andreas Granig Enviado el: miércoles, 19 de octubre de 2005 16:02 Para: Ing. Francisco Talavera CC: 'SER Users' Asunto: Re: [Serusers] RV: [Serdev] Parse Referred-By
Ing. Francisco Talavera wrote:
I need send to other Process the Referred_By header field in the Invite Method. How can I do this?
I read the Parser (parser/hf.h) directory but it can not parse this header field.
You only need to parse the header field if you want to load parts of it into avp or use them in other code parts of SER. In newer versions of SER (don't know exactly from which version upwards) you can also load the content of the header into avp using the avpops module.
If you just want to pass it to a script called by exec_dset() or exec_msg(), you can access any header field using the environment variable SIP_HF_<header-name>.
So I'm not sure if it's really needed to touch the parser unless you tell us how exactly you plan to use it.
Andy
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers