Consider the following snippet:

if (is_present_hf("Contact")) {
        xlog("L_ALERT", "===== reply to SUBSCRIBE has Contact: $ct\n");
        xlog("L_ALERT", "===== want to replace with $td\n");
        xlog("L_ALERT", "===== regexp to use is 
/$sel(cfg_get.asterisk.bindip):$sel(cfg_get.asterisk.bindport)/$td/\n");
        if (subst_hf("Contact", "/127.0.0.1:5080/$td/", "a")) {
                xlog("L_ALERT", "===== reply had Contact modified\n");
        }
}

If I use the hardcoded regexp "/127.0.0.1:5080/$td/", subst_hf() replaces the 
Contact value correctly.

However, if I use 
"/$sel(cfg_get.asterisk.bindip):$sel(cfg_get.asterisk.bindport)/$td/" (where 
asterisk.bindip and asterisk.bindport are the supposed values 127.0.0.1 and 5080), 
subst_hf() fails to replace the Contact value.

How do I make use of the existing configuration variables in order to 
substitute in the Contact header?

_______________________________________________
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

Reply via email to