19 dec 2012 kl. 19:35 skrev Daniel-Constantin Mierla <mico...@gmail.com>:
> > On 12/19/12 7:20 PM, Andreas Granig wrote: >> Hi Olle, >> >> On 12/19/2012 02:43 PM, Olle E. Johansson wrote: >>> Yeah, I already have Kamailio sending all kinds of crazy stuff while >>> testing a new platform, >>> using the UAC module. But I wanted to be lazy and change on the fly... >>> >>> Evil stuff happening here. Kamailio is a good test-tool. >>> >>> Now I fail to change Contact: headers. The docs for textops say that >>> remove_hf can remove >>> contact and Remove_hf(Contact) returns true - but the old contact is >>> still there! > Is this about generic operation of removing the contact header, or in the > context of taking it from old request and adding it to the new one generated > by uac_req()? For the second, Andreas pointed to the right direction. No, changing one and send it away. Like changing a Contact: in a register that's forwarded. > > I wanted to make the remark about changing the method on the fly directly to > the incoming request, that is not straight as it seems, because it has impact > on transaction management, the method being part of CSeq header and has to be > restored for the reply. Ouch. But if I'm totally and utterly stateless, would it work? /O > > With uac you can create a new transaction, but it will be in a new dialog. > > Cheers, > Daniel >> >> You could try using msg_apply_changes() from >> http://kamailio.org/docs/modules/stable/modules/textopsx.html#textopsx.msg_apply_changes >> after remove_hf and before actually building your new request with >> $uac_req, but this is really dangerous. >> >> One thing I know for sure is that you better not call record_route() >> anywhere before msg_apply_changes(), as record_route() only adds a hint to >> the message and the value is filled in once the sending socket is known >> (manually setting $fs doesn't seem to help). If you call msg_apply_changes() >> after record_route(), you'll get errors and will end up with a broken >> Record-Route header. >> >> Hope this helps, >> Andreas >> >> _______________________________________________ >> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list >> sr-users@lists.sip-router.org >> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users > > -- > Daniel-Constantin Mierla - http://www.asipto.com > http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda > > > _______________________________________________ > SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list > sr-users@lists.sip-router.org > http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users _______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users