Re: [OpenSIPS-Users] Adding custom headers when sending REFER with t_new_request function
Thank you very much Fabian, your solution works pretty well. Now I am able to add headers by this way. I would be grateful if developers can also explain us how we can use ctx for t_new_request function. Kind regards, Arda Tekin -Original Message- From: Users [mailto:users-boun...@lists.opensips.org] On Behalf Of Fabian Gast Sent: Thursday, October 10, 2019 9:22 AM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] Adding custom headers when sending REFER with t_new_request function Attention: This email was sent from someone outside of Afiniti. Always use caution when opening attachments, clicking links from unknown senders or when receiving unexpected emails. Hi, The ctx parameter never worked for me, i allways got a ERROR:tm:w_t_new_request: failed to add ctx AVP, ignorring... for this. I use something like t_new_request("OPTIONS","sip:ping@TODOMAIN:5061;transport=tls","sip:pong@DOMAIN","sip:ping@DOMAIN"); local_route { if (is_method("OPTIONS") && $rd == "TODOMAIN") { append_hf("X-MY-HEADER: asdfasdf\n\n"); } } maybe this helps you a little bit.. Fabian - Ursprüngliche Mail - > Von: "Tekin, Arda" > An: "OpenSIPS users mailling list" > Gesendet: Mittwoch, 9. Oktober 2019 22:46:02 > Betreff: [OpenSIPS-Users] Adding custom headers when sending REFER with > t_new_request function > Hello, > > > > I am trying to initiate and send a REFER message from OpenSIPS after > call hold signaling completed. > > > > t_new_request function of tm module allows to send this message > immediately, this is how I used the function, > > > > t_new_request("REFER", "sip:moh@172.16.30.166", "1001 > sip:1001@172.16.30.164", > "1000 sip:1000@172.16.30.164", "text/plain Hello Alice!"); > > > > but I need to add some extra headers into this message before sending > it. As far as I understand the last parameter (ctx) of function is used for > that purpose. > Could you please explain how I can use last parameter in order to add > multiple headers into message. ___ 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] Adding custom headers when sending REFER with t_new_request function
Hi, The ctx parameter never worked for me, i allways got a ERROR:tm:w_t_new_request: failed to add ctx AVP, ignorring... for this. I use something like t_new_request("OPTIONS","sip:ping@TODOMAIN:5061;transport=tls","sip:pong@DOMAIN","sip:ping@DOMAIN"); local_route { if (is_method("OPTIONS") && $rd == "TODOMAIN") { append_hf("X-MY-HEADER: asdfasdf\n\n"); } } maybe this helps you a little bit.. Fabian - Ursprüngliche Mail - > Von: "Tekin, Arda" > An: "OpenSIPS users mailling list" > Gesendet: Mittwoch, 9. Oktober 2019 22:46:02 > Betreff: [OpenSIPS-Users] Adding custom headers when sending REFER with > t_new_request function > Hello, > > > > I am trying to initiate and send a REFER message from OpenSIPS after call hold > signaling completed. > > > > t_new_request function of tm module allows to send this message immediately, > this is how I used the function, > > > > t_new_request("REFER", "sip:moh@172.16.30.166", "1001 sip:1001@172.16.30.164", > "1000 sip:1000@172.16.30.164", "text/plain Hello Alice!"); > > > > but I need to add some extra headers into this message before sending it. As > far > as I understand the last parameter (ctx) of function is used for that purpose. > Could you please explain how I can use last parameter in order to add multiple > headers into message. ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
[OpenSIPS-Users] Adding custom headers when sending REFER with t_new_request function
Hello, I am trying to initiate and send a REFER message from OpenSIPS after call hold signaling completed. t_new_request function of tm module allows to send this message immediately, this is how I used the function, t_new_request("REFER", "sip:moh@172.16.30.166", "1001 sip:1001@172.16.30.164", "1000 sip:1000@172.16.30.164", "text/plain Hello Alice!"); but I need to add some extra headers into this message before sending it. As far as I understand the last parameter (ctx) of function is used for that purpose. Could you please explain how I can use last parameter in order to add multiple headers into message. Thank you Arda ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users