« Back to SIP Transparency and Normalization Questions

RE: SIP Normalization Script - Insert Plus for a varable length dial plan

Combination View Flat View Tree View
Threads [ Previous | Next ]
Can anyone help out?  I need to insert a Plus in the the Diversion header User field.  The Mask fields listed are all fixed length.  The client has a veraible length dial plan.

You can try something like the below (haven't tested it):
1
2M = {}
3    function M.outbound_INVITE(msg)
4        local div = msg:getHeader("Diversion")")
5        local uri = string.gsub(div, "<", "<+")
6        msg:modifyHeader("Diversion")", uri)
7    end
8return M


Regards,
Yossi.