[pjsip] Outbound proxy

Gergely Kovacs gergo at iptel.org
Thu Nov 29 08:15:58 EST 2007


Hi Benny,

Thanks the hint, it works. I've already tried 'proxy' switch of 
pjsua-i686-pc-linux-gnu but it did not work. Now I've found the solution 
in simpleua.c:

"Note that Route URI SHOULD have an ";lr" parameter!"

I spent almost a whole day to get it worked, and now I've realized that 
I'd have added only three letters :)

-- 
Gergely Kovacs
http://www.iptel.org/~gergo



Benny Prijono wrote:
> Gergely Kovacs wrote:
>   
>> Hi,
>>
>> I'd like to make pjsip-perf send INVITE message with "From:
>> alice at atlanta.com", "To: bob at boston.com" headers and "bob at boston.com"
>> RURI to an outbound proxy specified by an IP address.
>>
>>
>>     pj_str_t proxy = {"sip:root at bug.sip-server.net", 27 };
>>
>>     status = pjsip_dlg_create_uac( pjsip_ua_instance(),
>>                    &from,    /* local URI      app.local_uri  */
>>                    &app.local_contact,    /* local Contact    */
>>                    dst_uri,        /* remote URI        */
>>                    &proxy,        /* remote target    */
>>                    &dlg);        /* dialog        */
>>
>> If I change remote target parameter of pjsip_dlg_create_uac function to
>> the address of proxy then the message will be sent to proxy correctly,
>> but the RURI is changed to the  address of proxy. If I use the
>> destination URI as remote target then PJSIP tries to resolve the domain
>> of destination URI which fails because it can't be found in DNS.
>>
>> I had a look at the source and I've not found any solution for this
>> problem at pjsip level. (I found that pjsip_transport_send() has a
>> Destination address parameter but I'd prefer pjsip_inv_send_msg())
>>
>> How could I send message to an outbound proxy?
>>
>>     
>
> Hi Gergely,
>
> the way to do this would be to set the route set for the dialog, 
> using something like:
>
> {
>    pjsip_route_header route_set, *route;
>    pj_str_t hname = pj_str("Route");
>    pj_str_t proxy = pj_str("sip:root at bug.sip-server.net");
>
>    pj_list_init(&route_set);
>    route = pjsip_parse_hdr(dlg->pool, &hname, proxy.ptr,
>                            proxy.slen, NULL);
>    pj_list_push_back(&route_set, route);
>
>    pjsip_dlg_set_route_set(dlg, &route_set);
> }
>
> cheers,
>   -benny
>
>
>
> _______________________________________________
> Visit our blog: http://blog.pjsip.org
>
> pjsip mailing list
> pjsip at lists.pjsip.org
> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>
>   




More information about the pjsip mailing list