If asterisk is in the path of the call, then just forward the REFER to it, there is no need to generate a new one.

Also, note that REFER is many times part of a dialog, uac_req_send() creates requests out of the dialog.

Cheers,
Daniel

On 1/16/11 11:37 PM, David J. wrote:
I realize that kamailio is not a b2bua;
But because we are using Asterisk in the path;

To extend the Asterisk Realtime Tutorial;

I was wondering if I could do something like this...

Kind of like how we use UAC to send a register to Asterisk;
Could we do the same and modify the method to use REFER instead?

I know it is more complex; but I am not sure where to handle this case;

Thanks for any pointers.

    if(is_method("REFER")){
        $var(rip) = $sel(cfg_get.asterisk.bindip);
        $uac_req(method)="REFER";
$uac_req(ruri)="sip:" + $var(rip) + ":" + $sel(cfg_get.asterisk.bindport);
        $uac_req(furi)="sip:" + $au + "@" + $var(rip) + ";tag=" + $ft;
        $uac_req(turi)="sip:" + $au + "@" + $var(rip) + ";tag=" + $tt;
        $uac_req(hdrs)="Contact: <sip:" + $au + "@"
                                + $sel(cfg_get.kamailio.bindip)
+ ":" + $sel(cfg_get.kamailio.bindport) + ">\r\n";
        if($sel(contact.expires) != $null)
$uac_req(hdrs)= $uac_req(hdrs) + "Expires: " + $sel(contact.expires) + "\r\n";
        else
$uac_req(hdrs)= $uac_req(hdrs) + "Expires: " + $hdr(Expires) + "\r\n";


         uac_req_send();


        }

_______________________________________________
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
Kamailio (OpenSER) Advanced Training
Jan 24-26, 2011, Irvine, CA, USA
http://www.asipto.com


_______________________________________________
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