[OpenSIPS-Users] build custom SIP header from ENUM query

Bogdan-Andrei Iancu bogdan at opensips.org
Thu Jul 4 17:47:05 CEST 2013


Hello Andrew,

Before sending back the 3xx reply, use the append_to_reply() function to
add additional headers:
    http://www.opensips.org/html/docs/modules/1.9.x/sipmsgops.html#id249127

Regards,

Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com


On 07/03/2013 03:04 AM, Andrew Melton wrote:
> We are currently using ENUM query to determine the LRN for a ported
> number.  This works fine, but now I am looking for a way to return
> some value in the NAPTR response which can be added as a custom header
> to a 302 response.  
>
> For example this response:
>
> 0.6.0.5.9.2.2.9.4.9.1.e164.org
> <http://0.6.0.5.9.2.2.9.4.9.1.e164.org>. 103 IN NAPTR   100 50 "u"
> "E2U+pstn:sip" "!^(.*)$!tel:\\1\;npdi\;rn=12139350001\;spid=979E!" .
>
> results in a 302:
>
> U 2013/07/02 20:40:03.902255 10.251.1.123:5060
> <http://10.251.1.123:5060> -> 192.168.1.1:5060
> <http://192.168.1.1:5060> SIP/2.0 302 Redirect
> Via: SIP/2.0/UDP 10.251.1.123:5060;branch=z9hG4bK1580013244rdb178
> To: <sip:+19492295555 at 192.168.1.1
> <mailto:sip%3A%2B19492295555 at 192.168.1.1>>;tag=e62e844df37eed41859feb28dd9c191b.e058
> From: <sip:2135551212 at 10.251.1.123
> <mailto:sip%3A2135551212 at 10.251.1.123>;otg=000622>;tag=580013244rdb178
> Call-ID: lnp-264160668-1-2940542680 at 10.251.1.123
> <mailto:lnp-264160668-1-2940542680 at 10.251.1.123>
> CSeq: 1 INVITE
> Contact: <tel:+19492295555;npdi;rn=12139350001;spid=979E>;q=0.99
> Content-Length: 0
>
> I would like to add an additional header to the 302, containing some
> other information, such as 'wireless':
>
> U 2013/07/02 20:40:03.902255 10.251.1.123:5060
> <http://10.251.1.123:5060> -> 192.168.1.1:5060
> <http://192.168.1.1:5060> SIP/2.0 302 Redirect
> Via: SIP/2.0/UDP 10.251.1.123:5060;branch=z9hG4bK1580013244rdb178
> To: <sip:+19492295555 at 192.168.1.1
> <mailto:sip%3A%2B19492295555 at 192.168.1.1>>;tag=e62e844df37eed41859feb28dd9c191b.e058
> From: <sip:2135551212 at 10.251.1.123
> <mailto:sip%3A2135551212 at 10.251.1.123>;otg=000622>;tag=580013244rdb178
> Call-ID: lnp-264160668-1-2940542680 at 10.251.1.123
> <mailto:lnp-264160668-1-2940542680 at 10.251.1.123>
> CSeq: 1 INVITE
> Contact: <tel:+19492295555;npdi;rn=12139350001;spid=979E>;q=0.99
> Content-Length: 0
> X-Phone-Type:  Wireless
>
> Does either the sipmsgops.so or enum.so modules have a way to use a
> portion of the NAPTR response to create (append_hf) a custom header
> (i.e. X-Phone-Type)?
>
> Thanks.
>
>
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20130704/9dc18d85/attachment.htm>


More information about the Users mailing list