Re: [OpenSIPS-Users] Getting header from 302
Hello again, So following up on this, I understood i could get the header from the 302 reply with: $(hdr(X-MyHeader)) Which is good, that works perfectly, but i can't verify the existence of that header with: is_present_hf("X-MyHeader") Is there a way of doing that or should i just check $(hdr(X-MyHeader)) is not $null? Regards, David Villasmil email: david.villasmil.w...@gmail.com phone: +34669448337 On Thu, Jun 3, 2021 at 2:27 PM David Villasmil < david.villasmil.w...@gmail.com> wrote: > Thanks Ben, > > I understand now. Perfect. > > David > > On Thu, 3 Jun 2021 at 14:24, Ben Newlin wrote: > >> Yes, if a reply route is armed or the global reply route exists, they are >> triggered first for any reply. Failure route, if armed, is triggered after >> that for any >=300 response codes. >> >> >> >> Ben Newlin >> >> >> >> *From: *Users on behalf of David >> Villasmil >> *Date: *Thursday, June 3, 2021 at 8:10 AM >> *To: *OpenSIPS users mailling list >> *Subject: *Re: [OpenSIPS-Users] Getting header from 302 >> >> Oh I didn’t register that param. I’ll try with that. >> >> On the other hand, I may be confused about how opensips processes >299 >> replies. Does it process them on onreply route and then goes to the failure >> route? I mean that’s what I’m doing right now, but is this intended by >> design? I would’ve though it’d go straight to the failure route, but >> actually going to the onreply route sounds smart. >> >> >> >> On Wed, 2 Jun 2021 at 22:08, Jeff Pyle wrote: >> >> I've been working on a proxy to sit between MS Teams and "normal" SIP >> stacks. Teams sends way too many 180s and RTP-less 183s so I sanitize them >> like this: >> >> onreply_route[relay_reply] { >> if (t_check_status("180")) { >> if (isflagset("GOT_180")) { >> drop; >> } else { >> setflag("GOT_180"); >> } >> } >> >> if (isflagset("GOT_180") && t_check_status("183")) { >> drop; >> } >> >> } >> >> >> >> With this I stop superfluous 18x messages from being relayed downstream. >> The 'drop' here kills the message completely. You could include the drop >> if you want to stop the message from being relayed (which you probably do) >> and are finished processing it in the script (which you are probably not). >> >> >> >> If I understand your application correctly, I'd populate the AVP in the >> reply route and do everything else in the failure route. Or, try Liviu's >> suggestion of using $(hdr(Identity)) in the failure_route directly. >> Either way, then continue in the failure_route to do whatever else needs to >> happen. >> >> >> >> >> >> - Jeff >> >> >> >> >> >> >> >> On Wed, Jun 2, 2021 at 2:10 PM David Villasmil < >> david.villasmil.w...@gmail.com> wrote: >> >> Hello Jeff, >> >> >> >> That's exactly what I'm doing: >> >> >> >> # Relay to REDIRECT server >> route[relay_to_REDIRECT] >> { >> t_on_reply("reply_from_REDIRECT"); >> t_on_failure("failure_from_REDIRECT"); >> >> xlog("L_ERR", "[$ci][$rm]: Relaying to REDIRECT"); >> if (!t_relay()) { >> xlog("L_ERR", "[$ci][$rm]: unable to relay request $ru to $tU -- >> replying with error"); >> sl_reply_error(); >> } >> >> exit; >> } >> >> # Response from REDIRECT will come in here. >> failure_route[failure_from_REDIRECT] >> { >> xlog("L_ERR", "[$ci][$rm]: I'm in >> failure_route[failover_from_REDIRECT]"); >> if (t_was_cancelled()) { >> exit; >> } >> >> if(is_avp_set("$avp(myheader)")) { >> xlog("L_ERR", "[$ci][$rm]: Got Identity Header: >> $(hdr(myheader))"); >> setflag(100); >> route(invite); >> } >> } >> >> # Response 302 from REDIRECT will come in here. >> onreply_route[reply_from_REDIRECT] >> { >> xlog("L_ERR", "[$ci][$rm]: I'm in >> onreply_route[reply_from_REDIRECT]"); >> if (t_was_cancelled()) { >> exit; >> } >> >> # detect redirect, store the header and send to "invite" as normally >> if (t_check_status("302") && is_present_hf("myheader")) { >> $avp(identity_header) = $(hdr(myheader)); >> setflag(100); >> drop(); >> } >> } >> >> >> >> So I suppose i don't need the drop()? >> >> >> >> Regards, >> >> >> >> David Villasmil >> >> email: david.villasmil.w...@gmail.com >> >> phone: +34669448337 >> >> >> >> ___ >> Users mailing list >> Users@lists.opensips.org >> http://lists.opensips.org/cgi-bin/mailman/listinfo/users >> > -- > Regards, > > David Villasmil > email: david.villasmil.w...@gmail.com > phone: +34669448337 > ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Getting header from 302
Thanks Ben, I understand now. Perfect. David On Thu, 3 Jun 2021 at 14:24, Ben Newlin wrote: > Yes, if a reply route is armed or the global reply route exists, they are > triggered first for any reply. Failure route, if armed, is triggered after > that for any >=300 response codes. > > > > Ben Newlin > > > > *From: *Users on behalf of David > Villasmil > *Date: *Thursday, June 3, 2021 at 8:10 AM > *To: *OpenSIPS users mailling list > *Subject: *Re: [OpenSIPS-Users] Getting header from 302 > > Oh I didn’t register that param. I’ll try with that. > > On the other hand, I may be confused about how opensips processes >299 > replies. Does it process them on onreply route and then goes to the failure > route? I mean that’s what I’m doing right now, but is this intended by > design? I would’ve though it’d go straight to the failure route, but > actually going to the onreply route sounds smart. > > > > On Wed, 2 Jun 2021 at 22:08, Jeff Pyle wrote: > > I've been working on a proxy to sit between MS Teams and "normal" SIP > stacks. Teams sends way too many 180s and RTP-less 183s so I sanitize them > like this: > > onreply_route[relay_reply] { > if (t_check_status("180")) { > if (isflagset("GOT_180")) { > drop; > } else { > setflag("GOT_180"); > } > } > > if (isflagset("GOT_180") && t_check_status("183")) { > drop; > } > > } > > > > With this I stop superfluous 18x messages from being relayed downstream. > The 'drop' here kills the message completely. You could include the drop > if you want to stop the message from being relayed (which you probably do) > and are finished processing it in the script (which you are probably not). > > > > If I understand your application correctly, I'd populate the AVP in the > reply route and do everything else in the failure route. Or, try Liviu's > suggestion of using $(hdr(Identity)) in the failure_route directly. > Either way, then continue in the failure_route to do whatever else needs to > happen. > > > > > > - Jeff > > > > > > > > On Wed, Jun 2, 2021 at 2:10 PM David Villasmil < > david.villasmil.w...@gmail.com> wrote: > > Hello Jeff, > > > > That's exactly what I'm doing: > > > > # Relay to REDIRECT server > route[relay_to_REDIRECT] > { > t_on_reply("reply_from_REDIRECT"); > t_on_failure("failure_from_REDIRECT"); > > xlog("L_ERR", "[$ci][$rm]: Relaying to REDIRECT"); > if (!t_relay()) { > xlog("L_ERR", "[$ci][$rm]: unable to relay request $ru to $tU -- > replying with error"); > sl_reply_error(); > } > > exit; > } > > # Response from REDIRECT will come in here. > failure_route[failure_from_REDIRECT] > { > xlog("L_ERR", "[$ci][$rm]: I'm in > failure_route[failover_from_REDIRECT]"); > if (t_was_cancelled()) { > exit; > } > > if(is_avp_set("$avp(myheader)")) { > xlog("L_ERR", "[$ci][$rm]: Got Identity Header: $(hdr(myheader))"); > setflag(100); > route(invite); > } > } > > # Response 302 from REDIRECT will come in here. > onreply_route[reply_from_REDIRECT] > { > xlog("L_ERR", "[$ci][$rm]: I'm in onreply_route[reply_from_REDIRECT]"); > if (t_was_cancelled()) { > exit; > } > > # detect redirect, store the header and send to "invite" as normally > if (t_check_status("302") && is_present_hf("myheader")) { > $avp(identity_header) = $(hdr(myheader)); > setflag(100); > drop(); > } > } > > > > So I suppose i don't need the drop()? > > > > Regards, > > > > David Villasmil > > email: david.villasmil.w...@gmail.com > > phone: +34669448337 > > > > ___ > Users mailing list > Users@lists.opensips.org > http://lists.opensips.org/cgi-bin/mailman/listinfo/users > -- Regards, David Villasmil email: david.villasmil.w...@gmail.com phone: +34669448337 ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Getting header from 302
Yes, if a reply route is armed or the global reply route exists, they are triggered first for any reply. Failure route, if armed, is triggered after that for any >=300 response codes. Ben Newlin From: Users on behalf of David Villasmil Date: Thursday, June 3, 2021 at 8:10 AM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] Getting header from 302 Oh I didn’t register that param. I’ll try with that. On the other hand, I may be confused about how opensips processes >299 replies. Does it process them on onreply route and then goes to the failure route? I mean that’s what I’m doing right now, but is this intended by design? I would’ve though it’d go straight to the failure route, but actually going to the onreply route sounds smart. On Wed, 2 Jun 2021 at 22:08, Jeff Pyle mailto:j...@ugnd.org>> wrote: I've been working on a proxy to sit between MS Teams and "normal" SIP stacks. Teams sends way too many 180s and RTP-less 183s so I sanitize them like this: onreply_route[relay_reply] { if (t_check_status("180")) { if (isflagset("GOT_180")) { drop; } else { setflag("GOT_180"); } } if (isflagset("GOT_180") && t_check_status("183")) { drop; } } With this I stop superfluous 18x messages from being relayed downstream. The 'drop' here kills the message completely. You could include the drop if you want to stop the message from being relayed (which you probably do) and are finished processing it in the script (which you are probably not). If I understand your application correctly, I'd populate the AVP in the reply route and do everything else in the failure route. Or, try Liviu's suggestion of using $(hdr(Identity)) in the failure_route directly. Either way, then continue in the failure_route to do whatever else needs to happen. - Jeff On Wed, Jun 2, 2021 at 2:10 PM David Villasmil mailto:david.villasmil.w...@gmail.com>> wrote: Hello Jeff, That's exactly what I'm doing: # Relay to REDIRECT server route[relay_to_REDIRECT] { t_on_reply("reply_from_REDIRECT"); t_on_failure("failure_from_REDIRECT"); xlog("L_ERR", "[$ci][$rm]: Relaying to REDIRECT"); if (!t_relay()) { xlog("L_ERR", "[$ci][$rm]: unable to relay request $ru to $tU -- replying with error"); sl_reply_error(); } exit; } # Response from REDIRECT will come in here. failure_route[failure_from_REDIRECT] { xlog("L_ERR", "[$ci][$rm]: I'm in failure_route[failover_from_REDIRECT]"); if (t_was_cancelled()) { exit; } if(is_avp_set("$avp(myheader)")) { xlog("L_ERR", "[$ci][$rm]: Got Identity Header: $(hdr(myheader))"); setflag(100); route(invite); } } # Response 302 from REDIRECT will come in here. onreply_route[reply_from_REDIRECT] { xlog("L_ERR", "[$ci][$rm]: I'm in onreply_route[reply_from_REDIRECT]"); if (t_was_cancelled()) { exit; } # detect redirect, store the header and send to "invite" as normally if (t_check_status("302") && is_present_hf("myheader")) { $avp(identity_header) = $(hdr(myheader)); setflag(100); drop(); } } So I suppose i don't need the drop()? Regards, David Villasmil email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com> phone: +34669448337 ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Getting header from 302
Oh I didn’t register that param. I’ll try with that. On the other hand, I may be confused about how opensips processes >299 replies. Does it process them on onreply route and then goes to the failure route? I mean that’s what I’m doing right now, but is this intended by design? I would’ve though it’d go straight to the failure route, but actually going to the onreply route sounds smart. On Wed, 2 Jun 2021 at 22:08, Jeff Pyle wrote: > I've been working on a proxy to sit between MS Teams and "normal" SIP > stacks. Teams sends way too many 180s and RTP-less 183s so I sanitize them > like this: > > onreply_route[relay_reply] { > if (t_check_status("180")) { > if (isflagset("GOT_180")) { > drop; > } else { > setflag("GOT_180"); > } > } > > if (isflagset("GOT_180") && t_check_status("183")) { > drop; > } > } > > With this I stop superfluous 18x messages from being relayed downstream. > The 'drop' here kills the message completely. You could include the drop > if you want to stop the message from being relayed (which you probably do) > and are finished processing it in the script (which you are probably not). > > If I understand your application correctly, I'd populate the AVP in the > reply route and do everything else in the failure route. Or, try Liviu's > suggestion of using $(hdr(Identity)) in the failure_route directly. > Either way, then continue in the failure_route to do whatever else needs to > happen. > > > - Jeff > > > > On Wed, Jun 2, 2021 at 2:10 PM David Villasmil < > david.villasmil.w...@gmail.com> wrote: > >> Hello Jeff, >> >> That's exactly what I'm doing: >> >> # Relay to REDIRECT server >> route[relay_to_REDIRECT] >> { >> t_on_reply("reply_from_REDIRECT"); >> t_on_failure("failure_from_REDIRECT"); >> >> xlog("L_ERR", "[$ci][$rm]: Relaying to REDIRECT"); >> if (!t_relay()) { >> xlog("L_ERR", "[$ci][$rm]: unable to relay request $ru to $tU -- >> replying with error"); >> sl_reply_error(); >> } >> >> exit; >> } >> >> # Response from REDIRECT will come in here. >> failure_route[failure_from_REDIRECT] >> { >> xlog("L_ERR", "[$ci][$rm]: I'm in >> failure_route[failover_from_REDIRECT]"); >> if (t_was_cancelled()) { >> exit; >> } >> >> if(is_avp_set("$avp(myheader)")) { >> xlog("L_ERR", "[$ci][$rm]: Got Identity Header: >> $(hdr(myheader))"); >> setflag(100); >> route(invite); >> } >> } >> >> # Response 302 from REDIRECT will come in here. >> onreply_route[reply_from_REDIRECT] >> { >> xlog("L_ERR", "[$ci][$rm]: I'm in >> onreply_route[reply_from_REDIRECT]"); >> if (t_was_cancelled()) { >> exit; >> } >> >> # detect redirect, store the header and send to "invite" as normally >> if (t_check_status("302") && is_present_hf("myheader")) { >> $avp(identity_header) = $(hdr(myheader)); >> setflag(100); >> drop(); >> } >> } >> >> So I suppose i don't need the drop()? >> >> Regards, >> >> David Villasmil >> email: david.villasmil.w...@gmail.com >> phone: +34669448337 >> >> >> On Wed, Jun 2, 2021 at 4:32 PM Jeff Pyle wrote: >> >>> If I arm both t_on_failure() and t_on_reply(), do a t_relay(), and a 302 >>> comes back, I have access to the reply in the onreply_route, then the >>> failure_route. From a SIP perspective, a 302 is a failure since it's not >>> 2xx-series, no? I don't do a drop() in the onreply_route. It just >>> naturally follows its course to the failure_route. >>> >>> David, in your case, since you're trying to drop any 302 that doesn't >>> have an Identity header, I'd check for its presence in the onreply_route >>> and set a flag if there accordingly. And, capture its value in an AVP if >>> you need. Next, in the failure_route, if (t_check_status("302") && >>> !isflagset("302_HAS_ID_HEADER")) drop; or something similar. You could >>> easily expand that block to route-advance to your next carrier, >>> send_reply(499, "Something Else"), or whatever you makes sense for your >>> application. >>> >>> >>> - Jeff >>> >>> On Wed, Jun 2, 2021 at 10:19 AM Johan De Clercq >>> wrote: >>> that's because 302 is not an error. So I guess that drop() is the only way. Op wo 2 jun. 2021 om 15:42 schreef David Villasmil < david.villasmil.w...@gmail.com>: > Thanks Ben, > > That’s a good point. But only way I’ve found to jump over from oneply > to failure_route is by doing a drop(). If there’s another way, I’d love to > know about it! > > David > > On Wed, 2 Jun 2021 at 08:29, Ben Newlin > wrote: > >> You still don’t need to call drop() as long as you are handling the >> request in failure_route. The 302 will not be sent back upstream as long >> as >> failure_route either creates a new branch request or sends back a >> diffe
Re: [OpenSIPS-Users] Getting header from 302
I've been working on a proxy to sit between MS Teams and "normal" SIP stacks. Teams sends way too many 180s and RTP-less 183s so I sanitize them like this: onreply_route[relay_reply] { if (t_check_status("180")) { if (isflagset("GOT_180")) { drop; } else { setflag("GOT_180"); } } if (isflagset("GOT_180") && t_check_status("183")) { drop; } } With this I stop superfluous 18x messages from being relayed downstream. The 'drop' here kills the message completely. You could include the drop if you want to stop the message from being relayed (which you probably do) and are finished processing it in the script (which you are probably not). If I understand your application correctly, I'd populate the AVP in the reply route and do everything else in the failure route. Or, try Liviu's suggestion of using $(hdr(Identity)) in the failure_route directly. Either way, then continue in the failure_route to do whatever else needs to happen. - Jeff On Wed, Jun 2, 2021 at 2:10 PM David Villasmil < david.villasmil.w...@gmail.com> wrote: > Hello Jeff, > > That's exactly what I'm doing: > > # Relay to REDIRECT server > route[relay_to_REDIRECT] > { > t_on_reply("reply_from_REDIRECT"); > t_on_failure("failure_from_REDIRECT"); > > xlog("L_ERR", "[$ci][$rm]: Relaying to REDIRECT"); > if (!t_relay()) { > xlog("L_ERR", "[$ci][$rm]: unable to relay request $ru to $tU -- > replying with error"); > sl_reply_error(); > } > > exit; > } > > # Response from REDIRECT will come in here. > failure_route[failure_from_REDIRECT] > { > xlog("L_ERR", "[$ci][$rm]: I'm in > failure_route[failover_from_REDIRECT]"); > if (t_was_cancelled()) { > exit; > } > > if(is_avp_set("$avp(myheader)")) { > xlog("L_ERR", "[$ci][$rm]: Got Identity Header: $(hdr(myheader))"); > setflag(100); > route(invite); > } > } > > # Response 302 from REDIRECT will come in here. > onreply_route[reply_from_REDIRECT] > { > xlog("L_ERR", "[$ci][$rm]: I'm in onreply_route[reply_from_REDIRECT]"); > if (t_was_cancelled()) { > exit; > } > > # detect redirect, store the header and send to "invite" as normally > if (t_check_status("302") && is_present_hf("myheader")) { > $avp(identity_header) = $(hdr(myheader)); > setflag(100); > drop(); > } > } > > So I suppose i don't need the drop()? > > Regards, > > David Villasmil > email: david.villasmil.w...@gmail.com > phone: +34669448337 > > > On Wed, Jun 2, 2021 at 4:32 PM Jeff Pyle wrote: > >> If I arm both t_on_failure() and t_on_reply(), do a t_relay(), and a 302 >> comes back, I have access to the reply in the onreply_route, then the >> failure_route. From a SIP perspective, a 302 is a failure since it's not >> 2xx-series, no? I don't do a drop() in the onreply_route. It just >> naturally follows its course to the failure_route. >> >> David, in your case, since you're trying to drop any 302 that doesn't >> have an Identity header, I'd check for its presence in the onreply_route >> and set a flag if there accordingly. And, capture its value in an AVP if >> you need. Next, in the failure_route, if (t_check_status("302") && >> !isflagset("302_HAS_ID_HEADER")) drop; or something similar. You could >> easily expand that block to route-advance to your next carrier, >> send_reply(499, "Something Else"), or whatever you makes sense for your >> application. >> >> >> - Jeff >> >> On Wed, Jun 2, 2021 at 10:19 AM Johan De Clercq wrote: >> >>> that's because 302 is not an error. >>> So I guess that drop() is the only way. >>> >>> Op wo 2 jun. 2021 om 15:42 schreef David Villasmil < >>> david.villasmil.w...@gmail.com>: >>> Thanks Ben, That’s a good point. But only way I’ve found to jump over from oneply to failure_route is by doing a drop(). If there’s another way, I’d love to know about it! David On Wed, 2 Jun 2021 at 08:29, Ben Newlin wrote: > You still don’t need to call drop() as long as you are handling the > request in failure_route. The 302 will not be sent back upstream as long > as > failure_route either creates a new branch request or sends back a > different > reply code. Only if failure_route exits without doing either of these > things would the downstream 302 be sent back upstream as-is. > > > > In fact, as far as I know drop() has no functionality for responses >= > 200. > > > > Ben Newlin > > > ___ >> Users mailing list >> Users@lists.opensips.org >> http://lists.opensips.org/cgi-bin/mailman/listinfo/users >> > ___ > Users mailing list > Users@lists.opensips.org > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Getting header from 302
Hello Jeff, That's exactly what I'm doing: # Relay to REDIRECT server route[relay_to_REDIRECT] { t_on_reply("reply_from_REDIRECT"); t_on_failure("failure_from_REDIRECT"); xlog("L_ERR", "[$ci][$rm]: Relaying to REDIRECT"); if (!t_relay()) { xlog("L_ERR", "[$ci][$rm]: unable to relay request $ru to $tU -- replying with error"); sl_reply_error(); } exit; } # Response from REDIRECT will come in here. failure_route[failure_from_REDIRECT] { xlog("L_ERR", "[$ci][$rm]: I'm in failure_route[failover_from_REDIRECT]"); if (t_was_cancelled()) { exit; } if(is_avp_set("$avp(myheader)")) { xlog("L_ERR", "[$ci][$rm]: Got Identity Header: $(hdr(myheader))"); setflag(100); route(invite); } } # Response 302 from REDIRECT will come in here. onreply_route[reply_from_REDIRECT] { xlog("L_ERR", "[$ci][$rm]: I'm in onreply_route[reply_from_REDIRECT]"); if (t_was_cancelled()) { exit; } # detect redirect, store the header and send to "invite" as normally if (t_check_status("302") && is_present_hf("myheader")) { $avp(identity_header) = $(hdr(myheader)); setflag(100); drop(); } } So I suppose i don't need the drop()? Regards, David Villasmil email: david.villasmil.w...@gmail.com phone: +34669448337 On Wed, Jun 2, 2021 at 4:32 PM Jeff Pyle wrote: > If I arm both t_on_failure() and t_on_reply(), do a t_relay(), and a 302 > comes back, I have access to the reply in the onreply_route, then the > failure_route. From a SIP perspective, a 302 is a failure since it's not > 2xx-series, no? I don't do a drop() in the onreply_route. It just > naturally follows its course to the failure_route. > > David, in your case, since you're trying to drop any 302 that doesn't have > an Identity header, I'd check for its presence in the onreply_route and set > a flag if there accordingly. And, capture its value in an AVP if you > need. Next, in the failure_route, if (t_check_status("302") && > !isflagset("302_HAS_ID_HEADER")) drop; or something similar. You could > easily expand that block to route-advance to your next carrier, > send_reply(499, "Something Else"), or whatever you makes sense for your > application. > > > - Jeff > > On Wed, Jun 2, 2021 at 10:19 AM Johan De Clercq wrote: > >> that's because 302 is not an error. >> So I guess that drop() is the only way. >> >> Op wo 2 jun. 2021 om 15:42 schreef David Villasmil < >> david.villasmil.w...@gmail.com>: >> >>> Thanks Ben, >>> >>> That’s a good point. But only way I’ve found to jump over from oneply to >>> failure_route is by doing a drop(). If there’s another way, I’d love to >>> know about it! >>> >>> David >>> >>> On Wed, 2 Jun 2021 at 08:29, Ben Newlin wrote: >>> You still don’t need to call drop() as long as you are handling the request in failure_route. The 302 will not be sent back upstream as long as failure_route either creates a new branch request or sends back a different reply code. Only if failure_route exits without doing either of these things would the downstream 302 be sent back upstream as-is. In fact, as far as I know drop() has no functionality for responses >= 200. Ben Newlin ___ > Users mailing list > Users@lists.opensips.org > http://lists.opensips.org/cgi-bin/mailman/listinfo/users > ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Getting header from 302
On 02.06.2021 18:31, Jeff Pyle wrote: if (t_check_status("302") && !isflagset("302_HAS_ID_HEADER")) Glancing over this flag-based code snippet, I just want to make sure Ben's earlier suggestion was not missed: Did you try accessing the Identity header within the failure_route, but using the $(hdr(Identity)) construct? And did it work as expected or not? -- Liviu Chircu www.twitter.com/liviuchircu | www.opensips-solutions.com OpenSIPS Summit 2021 Distributed | www.opensips.org/events ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Getting header from 302
If I arm both t_on_failure() and t_on_reply(), do a t_relay(), and a 302 comes back, I have access to the reply in the onreply_route, then the failure_route. From a SIP perspective, a 302 is a failure since it's not 2xx-series, no? I don't do a drop() in the onreply_route. It just naturally follows its course to the failure_route. David, in your case, since you're trying to drop any 302 that doesn't have an Identity header, I'd check for its presence in the onreply_route and set a flag if there accordingly. And, capture its value in an AVP if you need. Next, in the failure_route, if (t_check_status("302") && !isflagset("302_HAS_ID_HEADER")) drop; or something similar. You could easily expand that block to route-advance to your next carrier, send_reply(499, "Something Else"), or whatever you makes sense for your application. - Jeff On Wed, Jun 2, 2021 at 10:19 AM Johan De Clercq wrote: > that's because 302 is not an error. > So I guess that drop() is the only way. > > Op wo 2 jun. 2021 om 15:42 schreef David Villasmil < > david.villasmil.w...@gmail.com>: > >> Thanks Ben, >> >> That’s a good point. But only way I’ve found to jump over from oneply to >> failure_route is by doing a drop(). If there’s another way, I’d love to >> know about it! >> >> David >> >> On Wed, 2 Jun 2021 at 08:29, Ben Newlin wrote: >> >>> You still don’t need to call drop() as long as you are handling the >>> request in failure_route. The 302 will not be sent back upstream as long as >>> failure_route either creates a new branch request or sends back a different >>> reply code. Only if failure_route exits without doing either of these >>> things would the downstream 302 be sent back upstream as-is. >>> >>> >>> >>> In fact, as far as I know drop() has no functionality for responses >= >>> 200. >>> >>> >>> >>> Ben Newlin >>> >>> >>> ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Getting header from 302
that's because 302 is not an error. So I guess that drop() is the only way. Op wo 2 jun. 2021 om 15:42 schreef David Villasmil < david.villasmil.w...@gmail.com>: > Thanks Ben, > > That’s a good point. But only way I’ve found to jump over from oneply to > failure_route is by doing a drop(). If there’s another way, I’d love to > know about it! > > David > > On Wed, 2 Jun 2021 at 08:29, Ben Newlin wrote: > >> You still don’t need to call drop() as long as you are handling the >> request in failure_route. The 302 will not be sent back upstream as long as >> failure_route either creates a new branch request or sends back a different >> reply code. Only if failure_route exits without doing either of these >> things would the downstream 302 be sent back upstream as-is. >> >> >> >> In fact, as far as I know drop() has no functionality for responses >= >> 200. >> >> >> >> Ben Newlin >> >> >> >> *From: *Users on behalf of Jeff Pyle < >> j...@ugnd.org> >> *Date: *Tuesday, June 1, 2021 at 2:48 PM >> *To: *OpenSIPS users mailling list >> *Subject: *Re: [OpenSIPS-Users] Getting header from 302 >> >> Oh! Understood. >> >> >> >> >> >> - Jeff >> >> >> >> >> >> On Tue, Jun 1, 2021 at 2:42 PM David Villasmil < >> david.villasmil.w...@gmail.com> wrote: >> >> The thing is I _want_ to drop the 302, I don't want to do anything else >> with it. >> >> >> Regards, >> >> >> >> David Villasmil >> >> email: david.villasmil.w...@gmail.com >> >> phone: +34669448337 >> >> >> >> >> >> On Tue, Jun 1, 2021 at 6:46 PM Jeff Pyle wrote: >> >> In my experience you don't need drop() in the reply route. Just store >> the AVP and move on. Something like this: >> >> >> >> onreply_route[collect_identity] { >> >> if (is_present_hf("Identity")) { >> >> $avp(identity) := $hdr(Identity); >> >> setflag("GOT_IDENTITY"); >> >> } >> >> } >> >> >> >> If you've armed both the reply and failure routes with t_on_reply() and >> t_on_failure(), the $avp(identity) variable set here will be available in >> the failure_route. The GOT_IDENTITY flag, too. >> >> >> >> >> >> - Jeff >> >> >> >> >> >> >> >> - Jeff >> >> >> >> >> >> On Tue, Jun 1, 2021 at 11:20 AM David Villasmil < >> david.villasmil.w...@gmail.com> wrote: >> >> Yes, I see it is documented. >> >> >> >> So the reply header is only availanble on the "onreply" route, not on the >> "failure" route. That was my problem. I do indeed use an avp to store the >> header. >> >> I ended up getting the header on the "onreply" and storing it in an avp, >> set a flag and then drop(). I noticed the "failure" route is then executed. >> >> From there I can send the processing to the invite route and by checking >> the flag, adding the header from the avp. >> >> >> >> Thanks for your help! >> >> >> Regards, >> >> >> >> David Villasmil >> >> email: david.villasmil.w...@gmail.com >> >> phone: +34669448337 >> >> >> >> >> >> On Tue, Jun 1, 2021 at 3:52 PM Ben Newlin wrote: >> >> It’s documented that it works this way. The message being processed in >> failure_route is the original request; in reply_route it’s the reply. [1] >> >> >> >> You can use variable context to access the reply from failure_route [2]. >> Another option would be to extract the header value into and AVP in >> reply_route and then reference the AVP from failure_route. >> >> >> >> >> >> [1] - https://www.opensips.org/Documentation/Script-Routes-3-2 >> >> [2] - https://www.opensips.org/Documentation/Script-CoreVar-3-2 >> >> >> >> Ben Newlin >> >> >> >> *From: *Users on behalf of David >> Villasmil >> *Date: *Tuesday, June 1, 2021 at 10:43 AM >> *To: *OpenSIPS users mailling list >> *Subject: *Re: [OpenSIPS-Users] Getting header from 302 >> >> Yeah, my thing is when i use the failure route i can in theory grab the >> response header and ignore the 302 and send to the invite route again to &
Re: [OpenSIPS-Users] Getting header from 302
Thanks Ben, That’s a good point. But only way I’ve found to jump over from oneply to failure_route is by doing a drop(). If there’s another way, I’d love to know about it! David On Wed, 2 Jun 2021 at 08:29, Ben Newlin wrote: > You still don’t need to call drop() as long as you are handling the > request in failure_route. The 302 will not be sent back upstream as long as > failure_route either creates a new branch request or sends back a different > reply code. Only if failure_route exits without doing either of these > things would the downstream 302 be sent back upstream as-is. > > > > In fact, as far as I know drop() has no functionality for responses >= 200. > > > > Ben Newlin > > > > *From: *Users on behalf of Jeff Pyle < > j...@ugnd.org> > *Date: *Tuesday, June 1, 2021 at 2:48 PM > *To: *OpenSIPS users mailling list > *Subject: *Re: [OpenSIPS-Users] Getting header from 302 > > Oh! Understood. > > > > > > - Jeff > > > > > > On Tue, Jun 1, 2021 at 2:42 PM David Villasmil < > david.villasmil.w...@gmail.com> wrote: > > The thing is I _want_ to drop the 302, I don't want to do anything else > with it. > > > Regards, > > > > David Villasmil > > email: david.villasmil.w...@gmail.com > > phone: +34669448337 > > > > > > On Tue, Jun 1, 2021 at 6:46 PM Jeff Pyle wrote: > > In my experience you don't need drop() in the reply route. Just store > the AVP and move on. Something like this: > > > > onreply_route[collect_identity] { > > if (is_present_hf("Identity")) { > > $avp(identity) := $hdr(Identity); > > setflag("GOT_IDENTITY"); > > } > > } > > > > If you've armed both the reply and failure routes with t_on_reply() and > t_on_failure(), the $avp(identity) variable set here will be available in > the failure_route. The GOT_IDENTITY flag, too. > > > > > > - Jeff > > > > > > > > - Jeff > > > > > > On Tue, Jun 1, 2021 at 11:20 AM David Villasmil < > david.villasmil.w...@gmail.com> wrote: > > Yes, I see it is documented. > > > > So the reply header is only availanble on the "onreply" route, not on the > "failure" route. That was my problem. I do indeed use an avp to store the > header. > > I ended up getting the header on the "onreply" and storing it in an avp, > set a flag and then drop(). I noticed the "failure" route is then executed. > > From there I can send the processing to the invite route and by checking > the flag, adding the header from the avp. > > > > Thanks for your help! > > > Regards, > > > > David Villasmil > > email: david.villasmil.w...@gmail.com > > phone: +34669448337 > > > > > > On Tue, Jun 1, 2021 at 3:52 PM Ben Newlin wrote: > > It’s documented that it works this way. The message being processed in > failure_route is the original request; in reply_route it’s the reply. [1] > > > > You can use variable context to access the reply from failure_route [2]. > Another option would be to extract the header value into and AVP in > reply_route and then reference the AVP from failure_route. > > > > > > [1] - https://www.opensips.org/Documentation/Script-Routes-3-2 > > [2] - https://www.opensips.org/Documentation/Script-CoreVar-3-2 > > > > Ben Newlin > > > > *From: *Users on behalf of David > Villasmil > *Date: *Tuesday, June 1, 2021 at 10:43 AM > *To: *OpenSIPS users mailling list > *Subject: *Re: [OpenSIPS-Users] Getting header from 302 > > Yeah, my thing is when i use the failure route i can in theory grab the > response header and ignore the 302 and send to the invite route again to > actually send the call out via do_routing. > > What I'm trying to do is: > > - On receiving an invite: forward to an endpoint. > > - This endpoint will simply reply with 302 including a header. > > - I want to grab that header and continue routing normally (do_routing) > > > > I could do that with the failure route, but not so sure about the onreply > route. > > > Regards, > > > > David Villasmil > > email: david.villasmil.w...@gmail.com > > phone: +34669448337 > > > > > > On Tue, Jun 1, 2021 at 2:34 PM Jeff Pyle wrote: > > I don't think you're doing anything wrong. I think I found the same > thing, that headers on the reply were available only in a reply route and > not in a failure route. If you know where to look for them to populate the > AVP, I suppose it doesn
Re: [OpenSIPS-Users] Getting header from 302
You still don’t need to call drop() as long as you are handling the request in failure_route. The 302 will not be sent back upstream as long as failure_route either creates a new branch request or sends back a different reply code. Only if failure_route exits without doing either of these things would the downstream 302 be sent back upstream as-is. In fact, as far as I know drop() has no functionality for responses >= 200. Ben Newlin From: Users on behalf of Jeff Pyle Date: Tuesday, June 1, 2021 at 2:48 PM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] Getting header from 302 Oh! Understood. - Jeff On Tue, Jun 1, 2021 at 2:42 PM David Villasmil mailto:david.villasmil.w...@gmail.com>> wrote: The thing is I _want_ to drop the 302, I don't want to do anything else with it. Regards, David Villasmil email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com> phone: +34669448337 On Tue, Jun 1, 2021 at 6:46 PM Jeff Pyle mailto:j...@ugnd.org>> wrote: In my experience you don't need drop() in the reply route. Just store the AVP and move on. Something like this: onreply_route[collect_identity] { if (is_present_hf("Identity")) { $avp(identity) := $hdr(Identity); setflag("GOT_IDENTITY"); } } If you've armed both the reply and failure routes with t_on_reply() and t_on_failure(), the $avp(identity) variable set here will be available in the failure_route. The GOT_IDENTITY flag, too. - Jeff - Jeff On Tue, Jun 1, 2021 at 11:20 AM David Villasmil mailto:david.villasmil.w...@gmail.com>> wrote: Yes, I see it is documented. So the reply header is only availanble on the "onreply" route, not on the "failure" route. That was my problem. I do indeed use an avp to store the header. I ended up getting the header on the "onreply" and storing it in an avp, set a flag and then drop(). I noticed the "failure" route is then executed. >From there I can send the processing to the invite route and by checking the >flag, adding the header from the avp. Thanks for your help! Regards, David Villasmil email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com> phone: +34669448337 On Tue, Jun 1, 2021 at 3:52 PM Ben Newlin mailto:ben.new...@genesys.com>> wrote: It’s documented that it works this way. The message being processed in failure_route is the original request; in reply_route it’s the reply. [1] You can use variable context to access the reply from failure_route [2]. Another option would be to extract the header value into and AVP in reply_route and then reference the AVP from failure_route. [1] - https://www.opensips.org/Documentation/Script-Routes-3-2<https://www.opensips.org/Documentation/Script-Routes-3-2> [2] - https://www.opensips.org/Documentation/Script-CoreVar-3-2<https://www.opensips.org/Documentation/Script-CoreVar-3-2> Ben Newlin From: Users mailto:users-boun...@lists.opensips.org>> on behalf of David Villasmil mailto:david.villasmil.w...@gmail.com>> Date: Tuesday, June 1, 2021 at 10:43 AM To: OpenSIPS users mailling list mailto:users@lists.opensips.org>> Subject: Re: [OpenSIPS-Users] Getting header from 302 Yeah, my thing is when i use the failure route i can in theory grab the response header and ignore the 302 and send to the invite route again to actually send the call out via do_routing. What I'm trying to do is: - On receiving an invite: forward to an endpoint. - This endpoint will simply reply with 302 including a header. - I want to grab that header and continue routing normally (do_routing) I could do that with the failure route, but not so sure about the onreply route. Regards, David Villasmil email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com> phone: +34669448337 On Tue, Jun 1, 2021 at 2:34 PM Jeff Pyle mailto:j...@ugnd.org>> wrote: I don't think you're doing anything wrong. I think I found the same thing, that headers on the reply were available only in a reply route and not in a failure route. If you know where to look for them to populate the AVP, I suppose it doesn't matter much. I haven't looked at the code but I suspect all the routes other than an onreply_route give you access to the requests headers, and onreply_route gives you access to the reply headers. Makes sense I guess. - Jeff On Tue, Jun 1, 2021 at 9:31 AM David Villasmil mailto:david.villasmil.w...@gmail.com>> wrote: Thanks Jeff, MMM, that's strange, I was using it on failure route and the route was being executed, but the data wasn't there. I put it on the onreply route and that one is now executed with the data correctly there... I probably did something wrong. Thanks again Jeff! Regards, David Villasmil email: david.villasmil.w...@gmail.com<mailto:david
Re: [OpenSIPS-Users] Getting header from 302
Oh! Understood. - Jeff On Tue, Jun 1, 2021 at 2:42 PM David Villasmil < david.villasmil.w...@gmail.com> wrote: > The thing is I _want_ to drop the 302, I don't want to do anything else > with it. > > Regards, > > David Villasmil > email: david.villasmil.w...@gmail.com > phone: +34669448337 > > > On Tue, Jun 1, 2021 at 6:46 PM Jeff Pyle wrote: > >> In my experience you don't need drop() in the reply route. Just store >> the AVP and move on. Something like this: >> >> onreply_route[collect_identity] { >> if (is_present_hf("Identity")) { >> $avp(identity) := $hdr(Identity); >> setflag("GOT_IDENTITY"); >> } >> } >> >> If you've armed both the reply and failure routes with t_on_reply() and >> t_on_failure(), the $avp(identity) variable set here will be available in >> the failure_route. The GOT_IDENTITY flag, too. >> >> >> - Jeff >> >> >> >> - Jeff >> >> >> On Tue, Jun 1, 2021 at 11:20 AM David Villasmil < >> david.villasmil.w...@gmail.com> wrote: >> >>> Yes, I see it is documented. >>> >>> So the reply header is only availanble on the "onreply" route, not on >>> the "failure" route. That was my problem. I do indeed use an avp to store >>> the header. >>> I ended up getting the header on the "onreply" and storing it in an avp, >>> set a flag and then drop(). I noticed the "failure" route is then executed. >>> From there I can send the processing to the invite route and by >>> checking the flag, adding the header from the avp. >>> >>> Thanks for your help! >>> >>> Regards, >>> >>> David Villasmil >>> email: david.villasmil.w...@gmail.com >>> phone: +34669448337 >>> >>> >>> On Tue, Jun 1, 2021 at 3:52 PM Ben Newlin >>> wrote: >>> >>>> It’s documented that it works this way. The message being processed in >>>> failure_route is the original request; in reply_route it’s the reply. [1] >>>> >>>> >>>> >>>> You can use variable context to access the reply from failure_route >>>> [2]. Another option would be to extract the header value into and AVP in >>>> reply_route and then reference the AVP from failure_route. >>>> >>>> >>>> >>>> >>>> >>>> [1] - https://www.opensips.org/Documentation/Script-Routes-3-2 >>>> >>>> [2] - https://www.opensips.org/Documentation/Script-CoreVar-3-2 >>>> >>>> >>>> >>>> Ben Newlin >>>> >>>> >>>> >>>> *From: *Users on behalf of David >>>> Villasmil >>>> *Date: *Tuesday, June 1, 2021 at 10:43 AM >>>> *To: *OpenSIPS users mailling list >>>> *Subject: *Re: [OpenSIPS-Users] Getting header from 302 >>>> >>>> Yeah, my thing is when i use the failure route i can in theory grab the >>>> response header and ignore the 302 and send to the invite route again to >>>> actually send the call out via do_routing. >>>> >>>> What I'm trying to do is: >>>> >>>> - On receiving an invite: forward to an endpoint. >>>> >>>> - This endpoint will simply reply with 302 including a header. >>>> >>>> - I want to grab that header and continue routing normally (do_routing) >>>> >>>> >>>> >>>> I could do that with the failure route, but not so sure about the >>>> onreply route. >>>> >>>> >>>> Regards, >>>> >>>> >>>> >>>> David Villasmil >>>> >>>> email: david.villasmil.w...@gmail.com >>>> >>>> phone: +34669448337 >>>> >>>> >>>> >>>> >>>> >>>> On Tue, Jun 1, 2021 at 2:34 PM Jeff Pyle wrote: >>>> >>>> I don't think you're doing anything wrong. I think I found the same >>>> thing, that headers on the reply were available only in a reply route and >>>> not in a failure route. If you know where to look for them to populate the >>>> AVP, I suppose it doesn't matter much. >>>> >>>> >>>> >>>> I haven't looked at the code but I suspect all the routes other than
Re: [OpenSIPS-Users] Getting header from 302
The thing is I _want_ to drop the 302, I don't want to do anything else with it. Regards, David Villasmil email: david.villasmil.w...@gmail.com phone: +34669448337 On Tue, Jun 1, 2021 at 6:46 PM Jeff Pyle wrote: > In my experience you don't need drop() in the reply route. Just store > the AVP and move on. Something like this: > > onreply_route[collect_identity] { > if (is_present_hf("Identity")) { > $avp(identity) := $hdr(Identity); > setflag("GOT_IDENTITY"); > } > } > > If you've armed both the reply and failure routes with t_on_reply() and > t_on_failure(), the $avp(identity) variable set here will be available in > the failure_route. The GOT_IDENTITY flag, too. > > > - Jeff > > > > - Jeff > > > On Tue, Jun 1, 2021 at 11:20 AM David Villasmil < > david.villasmil.w...@gmail.com> wrote: > >> Yes, I see it is documented. >> >> So the reply header is only availanble on the "onreply" route, not on the >> "failure" route. That was my problem. I do indeed use an avp to store the >> header. >> I ended up getting the header on the "onreply" and storing it in an avp, >> set a flag and then drop(). I noticed the "failure" route is then executed. >> From there I can send the processing to the invite route and by checking >> the flag, adding the header from the avp. >> >> Thanks for your help! >> >> Regards, >> >> David Villasmil >> email: david.villasmil.w...@gmail.com >> phone: +34669448337 >> >> >> On Tue, Jun 1, 2021 at 3:52 PM Ben Newlin wrote: >> >>> It’s documented that it works this way. The message being processed in >>> failure_route is the original request; in reply_route it’s the reply. [1] >>> >>> >>> >>> You can use variable context to access the reply from failure_route [2]. >>> Another option would be to extract the header value into and AVP in >>> reply_route and then reference the AVP from failure_route. >>> >>> >>> >>> >>> >>> [1] - https://www.opensips.org/Documentation/Script-Routes-3-2 >>> >>> [2] - https://www.opensips.org/Documentation/Script-CoreVar-3-2 >>> >>> >>> >>> Ben Newlin >>> >>> >>> >>> *From: *Users on behalf of David >>> Villasmil >>> *Date: *Tuesday, June 1, 2021 at 10:43 AM >>> *To: *OpenSIPS users mailling list >>> *Subject: *Re: [OpenSIPS-Users] Getting header from 302 >>> >>> Yeah, my thing is when i use the failure route i can in theory grab the >>> response header and ignore the 302 and send to the invite route again to >>> actually send the call out via do_routing. >>> >>> What I'm trying to do is: >>> >>> - On receiving an invite: forward to an endpoint. >>> >>> - This endpoint will simply reply with 302 including a header. >>> >>> - I want to grab that header and continue routing normally (do_routing) >>> >>> >>> >>> I could do that with the failure route, but not so sure about the >>> onreply route. >>> >>> >>> Regards, >>> >>> >>> >>> David Villasmil >>> >>> email: david.villasmil.w...@gmail.com >>> >>> phone: +34669448337 >>> >>> >>> >>> >>> >>> On Tue, Jun 1, 2021 at 2:34 PM Jeff Pyle wrote: >>> >>> I don't think you're doing anything wrong. I think I found the same >>> thing, that headers on the reply were available only in a reply route and >>> not in a failure route. If you know where to look for them to populate the >>> AVP, I suppose it doesn't matter much. >>> >>> >>> >>> I haven't looked at the code but I suspect all the routes other than an >>> onreply_route give you access to the requests headers, and onreply_route >>> gives you access to the reply headers. Makes sense I guess. >>> >>> >>> >>> >>> >>> - Jeff >>> >>> >>> >>> >>> >>> On Tue, Jun 1, 2021 at 9:31 AM David Villasmil < >>> david.villasmil.w...@gmail.com> wrote: >>> >>> Thanks Jeff, >>> >>> >>> >>> MMM, that's strange, I was using it on failure route and the route was >>> being executed, but the data wasn't there. I p
Re: [OpenSIPS-Users] Getting header from 302
In my experience you don't need drop() in the reply route. Just store the AVP and move on. Something like this: onreply_route[collect_identity] { if (is_present_hf("Identity")) { $avp(identity) := $hdr(Identity); setflag("GOT_IDENTITY"); } } If you've armed both the reply and failure routes with t_on_reply() and t_on_failure(), the $avp(identity) variable set here will be available in the failure_route. The GOT_IDENTITY flag, too. - Jeff - Jeff On Tue, Jun 1, 2021 at 11:20 AM David Villasmil < david.villasmil.w...@gmail.com> wrote: > Yes, I see it is documented. > > So the reply header is only availanble on the "onreply" route, not on the > "failure" route. That was my problem. I do indeed use an avp to store the > header. > I ended up getting the header on the "onreply" and storing it in an avp, > set a flag and then drop(). I noticed the "failure" route is then executed. > From there I can send the processing to the invite route and by checking > the flag, adding the header from the avp. > > Thanks for your help! > > Regards, > > David Villasmil > email: david.villasmil.w...@gmail.com > phone: +34669448337 > > > On Tue, Jun 1, 2021 at 3:52 PM Ben Newlin wrote: > >> It’s documented that it works this way. The message being processed in >> failure_route is the original request; in reply_route it’s the reply. [1] >> >> >> >> You can use variable context to access the reply from failure_route [2]. >> Another option would be to extract the header value into and AVP in >> reply_route and then reference the AVP from failure_route. >> >> >> >> >> >> [1] - https://www.opensips.org/Documentation/Script-Routes-3-2 >> >> [2] - https://www.opensips.org/Documentation/Script-CoreVar-3-2 >> >> >> >> Ben Newlin >> >> >> >> *From: *Users on behalf of David >> Villasmil >> *Date: *Tuesday, June 1, 2021 at 10:43 AM >> *To: *OpenSIPS users mailling list >> *Subject: *Re: [OpenSIPS-Users] Getting header from 302 >> >> Yeah, my thing is when i use the failure route i can in theory grab the >> response header and ignore the 302 and send to the invite route again to >> actually send the call out via do_routing. >> >> What I'm trying to do is: >> >> - On receiving an invite: forward to an endpoint. >> >> - This endpoint will simply reply with 302 including a header. >> >> - I want to grab that header and continue routing normally (do_routing) >> >> >> >> I could do that with the failure route, but not so sure about the onreply >> route. >> >> >> Regards, >> >> >> >> David Villasmil >> >> email: david.villasmil.w...@gmail.com >> >> phone: +34669448337 >> >> >> >> >> >> On Tue, Jun 1, 2021 at 2:34 PM Jeff Pyle wrote: >> >> I don't think you're doing anything wrong. I think I found the same >> thing, that headers on the reply were available only in a reply route and >> not in a failure route. If you know where to look for them to populate the >> AVP, I suppose it doesn't matter much. >> >> >> >> I haven't looked at the code but I suspect all the routes other than an >> onreply_route give you access to the requests headers, and onreply_route >> gives you access to the reply headers. Makes sense I guess. >> >> >> >> >> >> - Jeff >> >> >> >> >> >> On Tue, Jun 1, 2021 at 9:31 AM David Villasmil < >> david.villasmil.w...@gmail.com> wrote: >> >> Thanks Jeff, >> >> >> >> MMM, that's strange, I was using it on failure route and the route was >> being executed, but the data wasn't there. I put it on the onreply route >> and that one is now executed with the data correctly there... >> >> >> >> I probably did something wrong. >> >> >> >> Thanks again Jeff! >> >> >> Regards, >> >> >> >> David Villasmil >> >> email: david.villasmil.w...@gmail.com >> >> phone: +34669448337 >> >> >> >> >> >> On Tue, Jun 1, 2021 at 12:37 PM Jeff Pyle wrote: >> >> In which route are you trying to use if (is_present_hf("Identity"))? >> Since the 302 is both a reply and a "failure", I suggest seeing if it >> appears in either the armed onreply_route or failure_route. >> >> >> >&g
Re: [OpenSIPS-Users] Getting header from 302
Yes, I see it is documented. So the reply header is only availanble on the "onreply" route, not on the "failure" route. That was my problem. I do indeed use an avp to store the header. I ended up getting the header on the "onreply" and storing it in an avp, set a flag and then drop(). I noticed the "failure" route is then executed. >From there I can send the processing to the invite route and by checking the flag, adding the header from the avp. Thanks for your help! Regards, David Villasmil email: david.villasmil.w...@gmail.com phone: +34669448337 On Tue, Jun 1, 2021 at 3:52 PM Ben Newlin wrote: > It’s documented that it works this way. The message being processed in > failure_route is the original request; in reply_route it’s the reply. [1] > > > > You can use variable context to access the reply from failure_route [2]. > Another option would be to extract the header value into and AVP in > reply_route and then reference the AVP from failure_route. > > > > > > [1] - https://www.opensips.org/Documentation/Script-Routes-3-2 > > [2] - https://www.opensips.org/Documentation/Script-CoreVar-3-2 > > > > Ben Newlin > > > > *From: *Users on behalf of David > Villasmil > *Date: *Tuesday, June 1, 2021 at 10:43 AM > *To: *OpenSIPS users mailling list > *Subject: *Re: [OpenSIPS-Users] Getting header from 302 > > Yeah, my thing is when i use the failure route i can in theory grab the > response header and ignore the 302 and send to the invite route again to > actually send the call out via do_routing. > > What I'm trying to do is: > > - On receiving an invite: forward to an endpoint. > > - This endpoint will simply reply with 302 including a header. > > - I want to grab that header and continue routing normally (do_routing) > > > > I could do that with the failure route, but not so sure about the onreply > route. > > > Regards, > > > > David Villasmil > > email: david.villasmil.w...@gmail.com > > phone: +34669448337 > > > > > > On Tue, Jun 1, 2021 at 2:34 PM Jeff Pyle wrote: > > I don't think you're doing anything wrong. I think I found the same > thing, that headers on the reply were available only in a reply route and > not in a failure route. If you know where to look for them to populate the > AVP, I suppose it doesn't matter much. > > > > I haven't looked at the code but I suspect all the routes other than an > onreply_route give you access to the requests headers, and onreply_route > gives you access to the reply headers. Makes sense I guess. > > > > > > - Jeff > > > > > > On Tue, Jun 1, 2021 at 9:31 AM David Villasmil < > david.villasmil.w...@gmail.com> wrote: > > Thanks Jeff, > > > > MMM, that's strange, I was using it on failure route and the route was > being executed, but the data wasn't there. I put it on the onreply route > and that one is now executed with the data correctly there... > > > > I probably did something wrong. > > > > Thanks again Jeff! > > > Regards, > > > > David Villasmil > > email: david.villasmil.w...@gmail.com > > phone: +34669448337 > > > > > > On Tue, Jun 1, 2021 at 12:37 PM Jeff Pyle wrote: > > In which route are you trying to use if (is_present_hf("Identity"))? > Since the 302 is both a reply and a "failure", I suggest seeing if it > appears in either the armed onreply_route or failure_route. > > > > I think From is available because it was present in the original request > route. > > > > > > - Jeff > > > > On Tue, Jun 1, 2021 at 5:39 AM David Villasmil < > david.villasmil.w...@gmail.com> wrote: > > Anyone has any idea about this? Appreciate your help. > > > > On Mon, 31 May 2021 at 21:11, David Villasmil < > david.villasmil.w...@gmail.com> wrote: > > So weird, > > I can get the From header, but not "Identity"... > > > Regards, > > > > David Villasmil > > email: david.villasmil.w...@gmail.com > > phone: +34669448337 > > > > > > On Mon, May 31, 2021 at 8:22 PM David Villasmil < > david.villasmil.w...@gmail.com> wrote: > > This is really weird, > > > > if (is_present_hf("Identity")) > > > > says it is not present, but it is! > > > Regards, > > > > David Villasmil > > email: david.villasmil.w...@gmail.com > > phone: +34669448337 > > > > > > On Mon, May 31, 2021 at 7:47 PM David Villas
Re: [OpenSIPS-Users] Getting header from 302
It’s documented that it works this way. The message being processed in failure_route is the original request; in reply_route it’s the reply. [1] You can use variable context to access the reply from failure_route [2]. Another option would be to extract the header value into and AVP in reply_route and then reference the AVP from failure_route. [1] - https://www.opensips.org/Documentation/Script-Routes-3-2 [2] - https://www.opensips.org/Documentation/Script-CoreVar-3-2 Ben Newlin From: Users on behalf of David Villasmil Date: Tuesday, June 1, 2021 at 10:43 AM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] Getting header from 302 Yeah, my thing is when i use the failure route i can in theory grab the response header and ignore the 302 and send to the invite route again to actually send the call out via do_routing. What I'm trying to do is: - On receiving an invite: forward to an endpoint. - This endpoint will simply reply with 302 including a header. - I want to grab that header and continue routing normally (do_routing) I could do that with the failure route, but not so sure about the onreply route. Regards, David Villasmil email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com> phone: +34669448337 On Tue, Jun 1, 2021 at 2:34 PM Jeff Pyle mailto:j...@ugnd.org>> wrote: I don't think you're doing anything wrong. I think I found the same thing, that headers on the reply were available only in a reply route and not in a failure route. If you know where to look for them to populate the AVP, I suppose it doesn't matter much. I haven't looked at the code but I suspect all the routes other than an onreply_route give you access to the requests headers, and onreply_route gives you access to the reply headers. Makes sense I guess. - Jeff On Tue, Jun 1, 2021 at 9:31 AM David Villasmil mailto:david.villasmil.w...@gmail.com>> wrote: Thanks Jeff, MMM, that's strange, I was using it on failure route and the route was being executed, but the data wasn't there. I put it on the onreply route and that one is now executed with the data correctly there... I probably did something wrong. Thanks again Jeff! Regards, David Villasmil email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com> phone: +34669448337 On Tue, Jun 1, 2021 at 12:37 PM Jeff Pyle mailto:j...@ugnd.org>> wrote: In which route are you trying to use if (is_present_hf("Identity"))? Since the 302 is both a reply and a "failure", I suggest seeing if it appears in either the armed onreply_route or failure_route. I think From is available because it was present in the original request route. - Jeff On Tue, Jun 1, 2021 at 5:39 AM David Villasmil mailto:david.villasmil.w...@gmail.com>> wrote: Anyone has any idea about this? Appreciate your help. On Mon, 31 May 2021 at 21:11, David Villasmil mailto:david.villasmil.w...@gmail.com>> wrote: So weird, I can get the From header, but not "Identity"... Regards, David Villasmil email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com> phone: +34669448337 On Mon, May 31, 2021 at 8:22 PM David Villasmil mailto:david.villasmil.w...@gmail.com>> wrote: This is really weird, if (is_present_hf("Identity")) says it is not present, but it is! Regards, David Villasmil email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com> phone: +34669448337 On Mon, May 31, 2021 at 7:47 PM David Villasmil mailto:david.villasmil.w...@gmail.com>> wrote: Hello Guys, I'm getting a header on a 302 which i'm trying to get, but for some reason I can't. This is an example 302: 2021/05/31 18:42:36.499157 10.231.32.237:5060<http://10.231.32.237:5060> -> 10.231.57.11:6075<http://10.231.57.11:6075> SIP/2.0 302 Redirect Via: SIP/2.0/UDP 1.2.3.4<http://1.2.3.4>:6075;branch=z9hG4bKd8e8.50036ee6.0;received=10.231.57.11 Via: SIP/2.0/UDP 10.231.33.135;branch=z9hG4bKd8e8.fe2738f41d26b2b68328691c326a077a.0 v:SIP/2.0/UDP 10.231.49.211:6060;received=10.231.49.211;rport=6060;branch=z9hG4bK68SgceeareaUa f:"+1888333"mailto:sip%3A%2B1888333@10.231.49.211>>;tag=ZBQ713X9pgD5S t:mailto:sip%3a1999...@domain.com>>;tag=9dd61ff61e802d8e2bef5f14621ef3c2.50cf6b6c i:cf649a38-3ce2-123a-eaad-122eaa5d9655 CSeq:36689486 INVITE Identity: eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9vcHMtc3RhdGljLnMzLmFtYXpvbmF3cy5jb20vc3Rpci1zaGFrZW4vZWMyNTYtcHVibGljLnBlbSJ9.eyJhdHRlc3QiO BIiwiZGVzdCI6eyJ0biI6WyIxNzg2NDEwNzgzNyJdfSwiaWF0IjoxNjIyNDg2NTU2LCJvcmlnIjp7InRuIjoiKzEzMTU5ODUyNTk0In0sIm9yaWdpZCI6IjhlZGE4M2Q1LWY1MjEtNDQzZC1iNDI0LWIzNDQ3MDc4ZjYxZCJ9.cjIz9VwlS9_6qA 6mmDgottk41BLpQcA40HdvV_6jAPqQ1EIL3_jLWl25oHeVEWOzTMhcERp4Jn-JZ4vP_n3w;info=<https://somedomain.com/stir-shaken/ec256-public.pem
Re: [OpenSIPS-Users] Getting header from 302
Yeah, my thing is when i use the failure route i can in theory grab the response header and ignore the 302 and send to the invite route again to actually send the call out via do_routing. What I'm trying to do is: - On receiving an invite: forward to an endpoint. - This endpoint will simply reply with 302 including a header. - I want to grab that header and continue routing normally (do_routing) I could do that with the failure route, but not so sure about the onreply route. Regards, David Villasmil email: david.villasmil.w...@gmail.com phone: +34669448337 On Tue, Jun 1, 2021 at 2:34 PM Jeff Pyle wrote: > I don't think you're doing anything wrong. I think I found the same > thing, that headers on the reply were available only in a reply route and > not in a failure route. If you know where to look for them to populate the > AVP, I suppose it doesn't matter much. > > I haven't looked at the code but I suspect all the routes other than an > onreply_route give you access to the requests headers, and onreply_route > gives you access to the reply headers. Makes sense I guess. > > > - Jeff > > > On Tue, Jun 1, 2021 at 9:31 AM David Villasmil < > david.villasmil.w...@gmail.com> wrote: > >> Thanks Jeff, >> >> MMM, that's strange, I was using it on failure route and the route was >> being executed, but the data wasn't there. I put it on the onreply route >> and that one is now executed with the data correctly there... >> >> I probably did something wrong. >> >> Thanks again Jeff! >> >> Regards, >> >> David Villasmil >> email: david.villasmil.w...@gmail.com >> phone: +34669448337 >> >> >> On Tue, Jun 1, 2021 at 12:37 PM Jeff Pyle wrote: >> >>> In which route are you trying to use if (is_present_hf("Identity"))? >>> Since the 302 is both a reply and a "failure", I suggest seeing if it >>> appears in either the armed onreply_route or failure_route. >>> >>> I think From is available because it was present in the original request >>> route. >>> >>> >>> - Jeff >>> >>> On Tue, Jun 1, 2021 at 5:39 AM David Villasmil < >>> david.villasmil.w...@gmail.com> wrote: >>> Anyone has any idea about this? Appreciate your help. On Mon, 31 May 2021 at 21:11, David Villasmil < david.villasmil.w...@gmail.com> wrote: > So weird, > I can get the From header, but not "Identity"... > > Regards, > > David Villasmil > email: david.villasmil.w...@gmail.com > phone: +34669448337 > > > On Mon, May 31, 2021 at 8:22 PM David Villasmil < > david.villasmil.w...@gmail.com> wrote: > >> This is really weird, >> >> if (is_present_hf("Identity")) >> >> says it is not present, but it is! >> >> Regards, >> >> David Villasmil >> email: david.villasmil.w...@gmail.com >> phone: +34669448337 >> >> >> On Mon, May 31, 2021 at 7:47 PM David Villasmil < >> david.villasmil.w...@gmail.com> wrote: >> >>> Hello Guys, >>> >>> I'm getting a header on a 302 which i'm trying to get, but for some >>> reason I can't. >>> >>> This is an example 302: >>> >>> 2021/05/31 18:42:36.499157 10.231.32.237:5060 -> 10.231.57.11:6075 >>> SIP/2.0 302 Redirect >>> Via: SIP/2.0/UDP 1.2.3.4: >>> 6075;branch=z9hG4bKd8e8.50036ee6.0;received=10.231.57.11 >>> Via: SIP/2.0/UDP >>> 10.231.33.135;branch=z9hG4bKd8e8.fe2738f41d26b2b68328691c326a077a.0 >>> v:SIP/2.0/UDP 10.231.49.211:6060 >>> ;received=10.231.49.211;rport=6060;branch=z9hG4bK68SgceeareaUa >>> f:"+1888333";tag=ZBQ713X9pgD5S >>> t:>> >;tag=9dd61ff61e802d8e2bef5f14621ef3c2.50cf6b6c >>> i:cf649a38-3ce2-123a-eaad-122eaa5d9655 >>> CSeq:36689486 INVITE >>> Identity: >>> eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9vcHMtc3RhdGljLnMzLmFtYXpvbmF3cy5jb20vc3Rpci1zaGFrZW4vZWMyNTYtcHVibGljLnBlbSJ9.eyJhdHRlc3QiO >>> >>> BIiwiZGVzdCI6eyJ0biI6WyIxNzg2NDEwNzgzNyJdfSwiaWF0IjoxNjIyNDg2NTU2LCJvcmlnIjp7InRuIjoiKzEzMTU5ODUyNTk0In0sIm9yaWdpZCI6IjhlZGE4M2Q1LWY1MjEtNDQzZC1iNDI0LWIzNDQ3MDc4ZjYxZCJ9.cjIz9VwlS9_6qA >>> >>> 6mmDgottk41BLpQcA40HdvV_6jAPqQ1EIL3_jLWl25oHeVEWOzTMhcERp4Jn-JZ4vP_n3w;info=< >>> https://somedomain.com/stir-shaken/ec256-public.pem >>> >;alg=ES256;ppt=shaken >>> Server: kamailio (5.5.0 (x86_64/linux)) >>> Content-Length: 0 >>> >>> I'm trying to get the "Identity" header with: >>> >>> $avp(identity_header) = $(hdr(Identity)); >>> >>> But It's coming up >>> >>> Any ideas of what I'm doing wrong? >>> >>> Regards, >>> >>> David Villasmil >>> email: david.villasmil.w...@gmail.com >>> phone: +34669448337 >>> >> -- Regards, David Villasmil email: david.villasmil.w...@gmail.com phone: +34669448337 ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/li
Re: [OpenSIPS-Users] Getting header from 302
I don't think you're doing anything wrong. I think I found the same thing, that headers on the reply were available only in a reply route and not in a failure route. If you know where to look for them to populate the AVP, I suppose it doesn't matter much. I haven't looked at the code but I suspect all the routes other than an onreply_route give you access to the requests headers, and onreply_route gives you access to the reply headers. Makes sense I guess. - Jeff On Tue, Jun 1, 2021 at 9:31 AM David Villasmil < david.villasmil.w...@gmail.com> wrote: > Thanks Jeff, > > MMM, that's strange, I was using it on failure route and the route was > being executed, but the data wasn't there. I put it on the onreply route > and that one is now executed with the data correctly there... > > I probably did something wrong. > > Thanks again Jeff! > > Regards, > > David Villasmil > email: david.villasmil.w...@gmail.com > phone: +34669448337 > > > On Tue, Jun 1, 2021 at 12:37 PM Jeff Pyle wrote: > >> In which route are you trying to use if (is_present_hf("Identity"))? >> Since the 302 is both a reply and a "failure", I suggest seeing if it >> appears in either the armed onreply_route or failure_route. >> >> I think From is available because it was present in the original request >> route. >> >> >> - Jeff >> >> On Tue, Jun 1, 2021 at 5:39 AM David Villasmil < >> david.villasmil.w...@gmail.com> wrote: >> >>> Anyone has any idea about this? Appreciate your help. >>> >>> On Mon, 31 May 2021 at 21:11, David Villasmil < >>> david.villasmil.w...@gmail.com> wrote: >>> So weird, I can get the From header, but not "Identity"... Regards, David Villasmil email: david.villasmil.w...@gmail.com phone: +34669448337 On Mon, May 31, 2021 at 8:22 PM David Villasmil < david.villasmil.w...@gmail.com> wrote: > This is really weird, > > if (is_present_hf("Identity")) > > says it is not present, but it is! > > Regards, > > David Villasmil > email: david.villasmil.w...@gmail.com > phone: +34669448337 > > > On Mon, May 31, 2021 at 7:47 PM David Villasmil < > david.villasmil.w...@gmail.com> wrote: > >> Hello Guys, >> >> I'm getting a header on a 302 which i'm trying to get, but for some >> reason I can't. >> >> This is an example 302: >> >> 2021/05/31 18:42:36.499157 10.231.32.237:5060 -> 10.231.57.11:6075 >> SIP/2.0 302 Redirect >> Via: SIP/2.0/UDP 1.2.3.4: >> 6075;branch=z9hG4bKd8e8.50036ee6.0;received=10.231.57.11 >> Via: SIP/2.0/UDP >> 10.231.33.135;branch=z9hG4bKd8e8.fe2738f41d26b2b68328691c326a077a.0 >> v:SIP/2.0/UDP 10.231.49.211:6060 >> ;received=10.231.49.211;rport=6060;branch=z9hG4bK68SgceeareaUa >> f:"+1888333";tag=ZBQ713X9pgD5S >> t:> >;tag=9dd61ff61e802d8e2bef5f14621ef3c2.50cf6b6c >> i:cf649a38-3ce2-123a-eaad-122eaa5d9655 >> CSeq:36689486 INVITE >> Identity: >> eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9vcHMtc3RhdGljLnMzLmFtYXpvbmF3cy5jb20vc3Rpci1zaGFrZW4vZWMyNTYtcHVibGljLnBlbSJ9.eyJhdHRlc3QiO >> >> BIiwiZGVzdCI6eyJ0biI6WyIxNzg2NDEwNzgzNyJdfSwiaWF0IjoxNjIyNDg2NTU2LCJvcmlnIjp7InRuIjoiKzEzMTU5ODUyNTk0In0sIm9yaWdpZCI6IjhlZGE4M2Q1LWY1MjEtNDQzZC1iNDI0LWIzNDQ3MDc4ZjYxZCJ9.cjIz9VwlS9_6qA >> >> 6mmDgottk41BLpQcA40HdvV_6jAPqQ1EIL3_jLWl25oHeVEWOzTMhcERp4Jn-JZ4vP_n3w;info=< >> https://somedomain.com/stir-shaken/ec256-public.pem >> >;alg=ES256;ppt=shaken >> Server: kamailio (5.5.0 (x86_64/linux)) >> Content-Length: 0 >> >> I'm trying to get the "Identity" header with: >> >> $avp(identity_header) = $(hdr(Identity)); >> >> But It's coming up >> >> Any ideas of what I'm doing wrong? >> >> Regards, >> >> David Villasmil >> email: david.villasmil.w...@gmail.com >> phone: +34669448337 >> > -- >>> Regards, >>> >>> David Villasmil >>> email: david.villasmil.w...@gmail.com >>> phone: +34669448337 >>> ___ >>> Users mailing list >>> Users@lists.opensips.org >>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users >>> >> ___ >> Users mailing list >> Users@lists.opensips.org >> http://lists.opensips.org/cgi-bin/mailman/listinfo/users >> > ___ > Users mailing list > Users@lists.opensips.org > http://lists.opensips.org/cgi-bin/mailman/listinfo/users > ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Getting header from 302
Thanks Jeff, MMM, that's strange, I was using it on failure route and the route was being executed, but the data wasn't there. I put it on the onreply route and that one is now executed with the data correctly there... I probably did something wrong. Thanks again Jeff! Regards, David Villasmil email: david.villasmil.w...@gmail.com phone: +34669448337 On Tue, Jun 1, 2021 at 12:37 PM Jeff Pyle wrote: > In which route are you trying to use if (is_present_hf("Identity"))? > Since the 302 is both a reply and a "failure", I suggest seeing if it > appears in either the armed onreply_route or failure_route. > > I think From is available because it was present in the original request > route. > > > - Jeff > > On Tue, Jun 1, 2021 at 5:39 AM David Villasmil < > david.villasmil.w...@gmail.com> wrote: > >> Anyone has any idea about this? Appreciate your help. >> >> On Mon, 31 May 2021 at 21:11, David Villasmil < >> david.villasmil.w...@gmail.com> wrote: >> >>> So weird, >>> I can get the From header, but not "Identity"... >>> >>> Regards, >>> >>> David Villasmil >>> email: david.villasmil.w...@gmail.com >>> phone: +34669448337 >>> >>> >>> On Mon, May 31, 2021 at 8:22 PM David Villasmil < >>> david.villasmil.w...@gmail.com> wrote: >>> This is really weird, if (is_present_hf("Identity")) says it is not present, but it is! Regards, David Villasmil email: david.villasmil.w...@gmail.com phone: +34669448337 On Mon, May 31, 2021 at 7:47 PM David Villasmil < david.villasmil.w...@gmail.com> wrote: > Hello Guys, > > I'm getting a header on a 302 which i'm trying to get, but for some > reason I can't. > > This is an example 302: > > 2021/05/31 18:42:36.499157 10.231.32.237:5060 -> 10.231.57.11:6075 > SIP/2.0 302 Redirect > Via: SIP/2.0/UDP 1.2.3.4: > 6075;branch=z9hG4bKd8e8.50036ee6.0;received=10.231.57.11 > Via: SIP/2.0/UDP > 10.231.33.135;branch=z9hG4bKd8e8.fe2738f41d26b2b68328691c326a077a.0 > v:SIP/2.0/UDP 10.231.49.211:6060 > ;received=10.231.49.211;rport=6060;branch=z9hG4bK68SgceeareaUa > f:"+1888333";tag=ZBQ713X9pgD5S > t: >;tag=9dd61ff61e802d8e2bef5f14621ef3c2.50cf6b6c > i:cf649a38-3ce2-123a-eaad-122eaa5d9655 > CSeq:36689486 INVITE > Identity: > eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9vcHMtc3RhdGljLnMzLmFtYXpvbmF3cy5jb20vc3Rpci1zaGFrZW4vZWMyNTYtcHVibGljLnBlbSJ9.eyJhdHRlc3QiO > > BIiwiZGVzdCI6eyJ0biI6WyIxNzg2NDEwNzgzNyJdfSwiaWF0IjoxNjIyNDg2NTU2LCJvcmlnIjp7InRuIjoiKzEzMTU5ODUyNTk0In0sIm9yaWdpZCI6IjhlZGE4M2Q1LWY1MjEtNDQzZC1iNDI0LWIzNDQ3MDc4ZjYxZCJ9.cjIz9VwlS9_6qA > > 6mmDgottk41BLpQcA40HdvV_6jAPqQ1EIL3_jLWl25oHeVEWOzTMhcERp4Jn-JZ4vP_n3w;info=< > https://somedomain.com/stir-shaken/ec256-public.pem > >;alg=ES256;ppt=shaken > Server: kamailio (5.5.0 (x86_64/linux)) > Content-Length: 0 > > I'm trying to get the "Identity" header with: > > $avp(identity_header) = $(hdr(Identity)); > > But It's coming up > > Any ideas of what I'm doing wrong? > > Regards, > > David Villasmil > email: david.villasmil.w...@gmail.com > phone: +34669448337 > -- >> Regards, >> >> David Villasmil >> email: david.villasmil.w...@gmail.com >> phone: +34669448337 >> ___ >> Users mailing list >> Users@lists.opensips.org >> http://lists.opensips.org/cgi-bin/mailman/listinfo/users >> > ___ > Users mailing list > Users@lists.opensips.org > http://lists.opensips.org/cgi-bin/mailman/listinfo/users > ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Getting header from 302
In which route are you trying to use if (is_present_hf("Identity"))? Since the 302 is both a reply and a "failure", I suggest seeing if it appears in either the armed onreply_route or failure_route. I think From is available because it was present in the original request route. - Jeff On Tue, Jun 1, 2021 at 5:39 AM David Villasmil < david.villasmil.w...@gmail.com> wrote: > Anyone has any idea about this? Appreciate your help. > > On Mon, 31 May 2021 at 21:11, David Villasmil < > david.villasmil.w...@gmail.com> wrote: > >> So weird, >> I can get the From header, but not "Identity"... >> >> Regards, >> >> David Villasmil >> email: david.villasmil.w...@gmail.com >> phone: +34669448337 >> >> >> On Mon, May 31, 2021 at 8:22 PM David Villasmil < >> david.villasmil.w...@gmail.com> wrote: >> >>> This is really weird, >>> >>> if (is_present_hf("Identity")) >>> >>> says it is not present, but it is! >>> >>> Regards, >>> >>> David Villasmil >>> email: david.villasmil.w...@gmail.com >>> phone: +34669448337 >>> >>> >>> On Mon, May 31, 2021 at 7:47 PM David Villasmil < >>> david.villasmil.w...@gmail.com> wrote: >>> Hello Guys, I'm getting a header on a 302 which i'm trying to get, but for some reason I can't. This is an example 302: 2021/05/31 18:42:36.499157 10.231.32.237:5060 -> 10.231.57.11:6075 SIP/2.0 302 Redirect Via: SIP/2.0/UDP 1.2.3.4: 6075;branch=z9hG4bKd8e8.50036ee6.0;received=10.231.57.11 Via: SIP/2.0/UDP 10.231.33.135;branch=z9hG4bKd8e8.fe2738f41d26b2b68328691c326a077a.0 v:SIP/2.0/UDP 10.231.49.211:6060 ;received=10.231.49.211;rport=6060;branch=z9hG4bK68SgceeareaUa f:"+1888333";tag=ZBQ713X9pgD5S t:>>> >;tag=9dd61ff61e802d8e2bef5f14621ef3c2.50cf6b6c i:cf649a38-3ce2-123a-eaad-122eaa5d9655 CSeq:36689486 INVITE Identity: eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9vcHMtc3RhdGljLnMzLmFtYXpvbmF3cy5jb20vc3Rpci1zaGFrZW4vZWMyNTYtcHVibGljLnBlbSJ9.eyJhdHRlc3QiO BIiwiZGVzdCI6eyJ0biI6WyIxNzg2NDEwNzgzNyJdfSwiaWF0IjoxNjIyNDg2NTU2LCJvcmlnIjp7InRuIjoiKzEzMTU5ODUyNTk0In0sIm9yaWdpZCI6IjhlZGE4M2Q1LWY1MjEtNDQzZC1iNDI0LWIzNDQ3MDc4ZjYxZCJ9.cjIz9VwlS9_6qA 6mmDgottk41BLpQcA40HdvV_6jAPqQ1EIL3_jLWl25oHeVEWOzTMhcERp4Jn-JZ4vP_n3w;info=< https://somedomain.com/stir-shaken/ec256-public.pem >;alg=ES256;ppt=shaken Server: kamailio (5.5.0 (x86_64/linux)) Content-Length: 0 I'm trying to get the "Identity" header with: $avp(identity_header) = $(hdr(Identity)); But It's coming up Any ideas of what I'm doing wrong? Regards, David Villasmil email: david.villasmil.w...@gmail.com phone: +34669448337 >>> -- > Regards, > > David Villasmil > email: david.villasmil.w...@gmail.com > phone: +34669448337 > ___ > Users mailing list > Users@lists.opensips.org > http://lists.opensips.org/cgi-bin/mailman/listinfo/users > ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Getting header from 302
Anyone has any idea about this? Appreciate your help. On Mon, 31 May 2021 at 21:11, David Villasmil < david.villasmil.w...@gmail.com> wrote: > So weird, > I can get the From header, but not "Identity"... > > Regards, > > David Villasmil > email: david.villasmil.w...@gmail.com > phone: +34669448337 > > > On Mon, May 31, 2021 at 8:22 PM David Villasmil < > david.villasmil.w...@gmail.com> wrote: > >> This is really weird, >> >> if (is_present_hf("Identity")) >> >> says it is not present, but it is! >> >> Regards, >> >> David Villasmil >> email: david.villasmil.w...@gmail.com >> phone: +34669448337 >> >> >> On Mon, May 31, 2021 at 7:47 PM David Villasmil < >> david.villasmil.w...@gmail.com> wrote: >> >>> Hello Guys, >>> >>> I'm getting a header on a 302 which i'm trying to get, but for some >>> reason I can't. >>> >>> This is an example 302: >>> >>> 2021/05/31 18:42:36.499157 10.231.32.237:5060 -> 10.231.57.11:6075 >>> SIP/2.0 302 Redirect >>> Via: SIP/2.0/UDP 1.2.3.4: >>> 6075;branch=z9hG4bKd8e8.50036ee6.0;received=10.231.57.11 >>> Via: SIP/2.0/UDP >>> 10.231.33.135;branch=z9hG4bKd8e8.fe2738f41d26b2b68328691c326a077a.0 >>> v:SIP/2.0/UDP 10.231.49.211:6060 >>> ;received=10.231.49.211;rport=6060;branch=z9hG4bK68SgceeareaUa >>> f:"+1888333";tag=ZBQ713X9pgD5S >>> t:>> >;tag=9dd61ff61e802d8e2bef5f14621ef3c2.50cf6b6c >>> i:cf649a38-3ce2-123a-eaad-122eaa5d9655 >>> CSeq:36689486 INVITE >>> Identity: >>> eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9vcHMtc3RhdGljLnMzLmFtYXpvbmF3cy5jb20vc3Rpci1zaGFrZW4vZWMyNTYtcHVibGljLnBlbSJ9.eyJhdHRlc3QiO >>> >>> BIiwiZGVzdCI6eyJ0biI6WyIxNzg2NDEwNzgzNyJdfSwiaWF0IjoxNjIyNDg2NTU2LCJvcmlnIjp7InRuIjoiKzEzMTU5ODUyNTk0In0sIm9yaWdpZCI6IjhlZGE4M2Q1LWY1MjEtNDQzZC1iNDI0LWIzNDQ3MDc4ZjYxZCJ9.cjIz9VwlS9_6qA >>> >>> 6mmDgottk41BLpQcA40HdvV_6jAPqQ1EIL3_jLWl25oHeVEWOzTMhcERp4Jn-JZ4vP_n3w;info=< >>> https://somedomain.com/stir-shaken/ec256-public.pem >>> >;alg=ES256;ppt=shaken >>> Server: kamailio (5.5.0 (x86_64/linux)) >>> Content-Length: 0 >>> >>> I'm trying to get the "Identity" header with: >>> >>> $avp(identity_header) = $(hdr(Identity)); >>> >>> But It's coming up >>> >>> Any ideas of what I'm doing wrong? >>> >>> Regards, >>> >>> David Villasmil >>> email: david.villasmil.w...@gmail.com >>> phone: +34669448337 >>> >> -- Regards, David Villasmil email: david.villasmil.w...@gmail.com phone: +34669448337 ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Getting header from 302
So weird, I can get the From header, but not "Identity"... Regards, David Villasmil email: david.villasmil.w...@gmail.com phone: +34669448337 On Mon, May 31, 2021 at 8:22 PM David Villasmil < david.villasmil.w...@gmail.com> wrote: > This is really weird, > > if (is_present_hf("Identity")) > > says it is not present, but it is! > > Regards, > > David Villasmil > email: david.villasmil.w...@gmail.com > phone: +34669448337 > > > On Mon, May 31, 2021 at 7:47 PM David Villasmil < > david.villasmil.w...@gmail.com> wrote: > >> Hello Guys, >> >> I'm getting a header on a 302 which i'm trying to get, but for some >> reason I can't. >> >> This is an example 302: >> >> 2021/05/31 18:42:36.499157 10.231.32.237:5060 -> 10.231.57.11:6075 >> SIP/2.0 302 Redirect >> Via: SIP/2.0/UDP 1.2.3.4: >> 6075;branch=z9hG4bKd8e8.50036ee6.0;received=10.231.57.11 >> Via: SIP/2.0/UDP >> 10.231.33.135;branch=z9hG4bKd8e8.fe2738f41d26b2b68328691c326a077a.0 >> v:SIP/2.0/UDP 10.231.49.211:6060 >> ;received=10.231.49.211;rport=6060;branch=z9hG4bK68SgceeareaUa >> f:"+1888333";tag=ZBQ713X9pgD5S >> t:> >;tag=9dd61ff61e802d8e2bef5f14621ef3c2.50cf6b6c >> i:cf649a38-3ce2-123a-eaad-122eaa5d9655 >> CSeq:36689486 INVITE >> Identity: >> eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9vcHMtc3RhdGljLnMzLmFtYXpvbmF3cy5jb20vc3Rpci1zaGFrZW4vZWMyNTYtcHVibGljLnBlbSJ9.eyJhdHRlc3QiO >> >> BIiwiZGVzdCI6eyJ0biI6WyIxNzg2NDEwNzgzNyJdfSwiaWF0IjoxNjIyNDg2NTU2LCJvcmlnIjp7InRuIjoiKzEzMTU5ODUyNTk0In0sIm9yaWdpZCI6IjhlZGE4M2Q1LWY1MjEtNDQzZC1iNDI0LWIzNDQ3MDc4ZjYxZCJ9.cjIz9VwlS9_6qA >> >> 6mmDgottk41BLpQcA40HdvV_6jAPqQ1EIL3_jLWl25oHeVEWOzTMhcERp4Jn-JZ4vP_n3w;info=< >> https://somedomain.com/stir-shaken/ec256-public.pem>;alg=ES256;ppt=shaken >> Server: kamailio (5.5.0 (x86_64/linux)) >> Content-Length: 0 >> >> I'm trying to get the "Identity" header with: >> >> $avp(identity_header) = $(hdr(Identity)); >> >> But It's coming up >> >> Any ideas of what I'm doing wrong? >> >> Regards, >> >> David Villasmil >> email: david.villasmil.w...@gmail.com >> phone: +34669448337 >> > ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Getting header from 302
This is really weird, if (is_present_hf("Identity")) says it is not present, but it is! Regards, David Villasmil email: david.villasmil.w...@gmail.com phone: +34669448337 On Mon, May 31, 2021 at 7:47 PM David Villasmil < david.villasmil.w...@gmail.com> wrote: > Hello Guys, > > I'm getting a header on a 302 which i'm trying to get, but for some reason > I can't. > > This is an example 302: > > 2021/05/31 18:42:36.499157 10.231.32.237:5060 -> 10.231.57.11:6075 > SIP/2.0 302 Redirect > Via: SIP/2.0/UDP 1.2.3.4: > 6075;branch=z9hG4bKd8e8.50036ee6.0;received=10.231.57.11 > Via: SIP/2.0/UDP > 10.231.33.135;branch=z9hG4bKd8e8.fe2738f41d26b2b68328691c326a077a.0 > v:SIP/2.0/UDP 10.231.49.211:6060 > ;received=10.231.49.211;rport=6060;branch=z9hG4bK68SgceeareaUa > f:"+1888333";tag=ZBQ713X9pgD5S > t: >;tag=9dd61ff61e802d8e2bef5f14621ef3c2.50cf6b6c > i:cf649a38-3ce2-123a-eaad-122eaa5d9655 > CSeq:36689486 INVITE > Identity: > eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9vcHMtc3RhdGljLnMzLmFtYXpvbmF3cy5jb20vc3Rpci1zaGFrZW4vZWMyNTYtcHVibGljLnBlbSJ9.eyJhdHRlc3QiO > > BIiwiZGVzdCI6eyJ0biI6WyIxNzg2NDEwNzgzNyJdfSwiaWF0IjoxNjIyNDg2NTU2LCJvcmlnIjp7InRuIjoiKzEzMTU5ODUyNTk0In0sIm9yaWdpZCI6IjhlZGE4M2Q1LWY1MjEtNDQzZC1iNDI0LWIzNDQ3MDc4ZjYxZCJ9.cjIz9VwlS9_6qA > > 6mmDgottk41BLpQcA40HdvV_6jAPqQ1EIL3_jLWl25oHeVEWOzTMhcERp4Jn-JZ4vP_n3w;info=< > https://somedomain.com/stir-shaken/ec256-public.pem>;alg=ES256;ppt=shaken > Server: kamailio (5.5.0 (x86_64/linux)) > Content-Length: 0 > > I'm trying to get the "Identity" header with: > > $avp(identity_header) = $(hdr(Identity)); > > But It's coming up > > Any ideas of what I'm doing wrong? > > Regards, > > David Villasmil > email: david.villasmil.w...@gmail.com > phone: +34669448337 > ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
[OpenSIPS-Users] Getting header from 302
Hello Guys, I'm getting a header on a 302 which i'm trying to get, but for some reason I can't. This is an example 302: 2021/05/31 18:42:36.499157 10.231.32.237:5060 -> 10.231.57.11:6075 SIP/2.0 302 Redirect Via: SIP/2.0/UDP 1.2.3.4: 6075;branch=z9hG4bKd8e8.50036ee6.0;received=10.231.57.11 Via: SIP/2.0/UDP 10.231.33.135;branch=z9hG4bKd8e8.fe2738f41d26b2b68328691c326a077a.0 v:SIP/2.0/UDP 10.231.49.211:6060 ;received=10.231.49.211;rport=6060;branch=z9hG4bK68SgceeareaUa f:"+1888333";tag=ZBQ713X9pgD5S t:;tag=9dd61ff61e802d8e2bef5f14621ef3c2.50cf6b6c i:cf649a38-3ce2-123a-eaad-122eaa5d9655 CSeq:36689486 INVITE Identity: eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9vcHMtc3RhdGljLnMzLmFtYXpvbmF3cy5jb20vc3Rpci1zaGFrZW4vZWMyNTYtcHVibGljLnBlbSJ9.eyJhdHRlc3QiO BIiwiZGVzdCI6eyJ0biI6WyIxNzg2NDEwNzgzNyJdfSwiaWF0IjoxNjIyNDg2NTU2LCJvcmlnIjp7InRuIjoiKzEzMTU5ODUyNTk0In0sIm9yaWdpZCI6IjhlZGE4M2Q1LWY1MjEtNDQzZC1iNDI0LWIzNDQ3MDc4ZjYxZCJ9.cjIz9VwlS9_6qA 6mmDgottk41BLpQcA40HdvV_6jAPqQ1EIL3_jLWl25oHeVEWOzTMhcERp4Jn-JZ4vP_n3w;info=< https://somedomain.com/stir-shaken/ec256-public.pem>;alg=ES256;ppt=shaken Server: kamailio (5.5.0 (x86_64/linux)) Content-Length: 0 I'm trying to get the "Identity" header with: $avp(identity_header) = $(hdr(Identity)); But It's coming up Any ideas of what I'm doing wrong? Regards, David Villasmil email: david.villasmil.w...@gmail.com phone: +34669448337 ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users