|
@@ -512,6 +512,24 @@ static int w_replace_to(struct sip_msg* msg, char* p1, char* p2)
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+int replace_to_api(sip_msg_t *msg, str* pd, str* pu)
|
|
|
|
+{
|
|
|
|
+ str *uri;
|
|
|
|
+ str *dsp;
|
|
|
|
+ if ( msg->to==0 && (parse_headers(msg,HDR_TO_F,0)!=0 || msg->to==0) ) {
|
|
|
|
+ LM_ERR("failed to find/parse TO hdr\n");
|
|
|
|
+ return -1;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ uri = (pu!=NULL && pu->len>0)?pu:NULL;
|
|
|
|
+ dsp = (pd!=NULL && pd->len>0)?pd:NULL;
|
|
|
|
+
|
|
|
|
+ LM_DBG("dsp=%p (len=%d) , uri=%p (len=%d)\n", dsp, dsp?dsp->len:0,
|
|
|
|
+ uri, uri?uri->len:0);
|
|
|
|
+
|
|
|
|
+ return replace_uri(msg, dsp, uri, msg->to, &rr_to_param, &restore_to_avp, 0);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
|
|
static int w_uac_auth(struct sip_msg* msg, char* str, char* str2)
|
|
static int w_uac_auth(struct sip_msg* msg, char* str, char* str2)
|
|
{
|
|
{
|
|
@@ -582,6 +600,7 @@ int bind_uac(uac_api_t *uacb)
|
|
|
|
|
|
memset(uacb, 0, sizeof(uac_api_t));
|
|
memset(uacb, 0, sizeof(uac_api_t));
|
|
uacb->replace_from = replace_from_api;
|
|
uacb->replace_from = replace_from_api;
|
|
|
|
+ uacb->replace_to = replace_to_api;
|
|
uacb->req_send = uac_req_send;
|
|
uacb->req_send = uac_req_send;
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|