settign transport_param in sip_uri (SIP over TCP problem)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi again,
I am using UDP now. but still the same problem.

here is some snap of the code

//add UDP tranport

	pjsua_transport_config trans_cfg_UDP;
	pjsua_transport_config_default(&trans_cfg_UDP);
	trans_cfg.public_addr = pj_str("xxx.yyy.zzz.146");

	status = pjsua_transport_create(PJSIP_TRANSPORT_UDP, &trans_cfg_UDP,
&trans_id_UDP);
	if(status != PJ_SUCCESS)
	{
		error_exit("Error in creating UDP transport", status);
	}


acc_cfg.id = pj_str(uri);
		acc_cfg.reg_uri = pj_str ("sip:"MYdomain);
		acc_cfg.cred_count = 1;
		acc_cfg.cred_info[0].realm = pj_str("*");
		acc_cfg.cred_info[0].scheme = pj_str("digest");
		acc_cfg.cred_info[0].username = pj_str(user);
		acc_cfg.cred_info[0].data_type = PJSIP_CRED_DATA_PLAIN_PASSWD;
		acc_cfg.cred_info[0].data = pj_str(pass);
	}
	

	status = pjsua_acc_add(&acc_cfg,PJ_TRUE,&acc_id);
	if(status != PJ_SUCCESS)
	{
		error_exit("Error in registration", status);
	}

        pj_str_t uri = pj_str(URI);

	status = pjsua_call_make_call(acc_id,&uri,0,NULL,NULL,NULL);
	if(status != PJ_SUCCESS)
	{
		error_exit("Error in Making call", status);
	}


Can you get the problem?

//
EMON

On Fri, Jul 11, 2008 at 5:39 PM, Benny Prijono <bennylp at pjsip.org> wrote:
> On Fri, Jul 11, 2008 at 4:35 PM, Zahed Emon <ena2413 at gmail.com> wrote:
>>
>> Hi benny
>>
>> thanks for the reply. Yes I am intended to work with multihomed devices.
>>
>> ans putting , transport=TCP in URI works.
>>
>> but I have some problem with INVITE (make call).
>>
>> the client tries to send the invite to some ip "64.14.244.60" instead
>> of sending it to the SIP server .
>
> I suspect you probably misconfigured the route set? Forgot to add ";lr"
> parameter in the route URI perhaps?
>
> Cheers
>  Benny
>
>
>
>
>>
>> I tried to set my public IP but it does not stop doing this.
>>
>> What could be the reasons?
>>
>> //
>>
>> EMON
>>
>> On Thu, Jul 10, 2008 at 8:31 PM, Benny Prijono <bennylp at pjsip.org> wrote:
>> > On Thu, Jul 10, 2008 at 3:25 PM, Zahed Emon <ena2413 at gmail.com> wrote:
>> >>
>> >> Hi,
>> >>
>> >> I am trying to register my client using TCP.
>> >>
>> >> I have created the TCP transport and  did the registration with
>> >> pjsua_acc_add
>> >>
>> >>        acc_cfg.id = pj_str(uri);
>> >>        acc_cfg.reg_uri = pj_str (sip_domain);
>> >>        acc_cfg.cred_count = 1;
>> >>        acc_cfg.cred_info[0].realm = pj_str("*");
>> >>        acc_cfg.cred_info[0].scheme = pj_str("digest");
>> >>        acc_cfg.cred_info[0].username = pj_str(user);
>> >>        acc_cfg.cred_info[0].data_type = PJSIP_CRED_DATA_PLAIN_PASSWD;
>> >>        acc_cfg.cred_info[0].data = pj_str(pass);
>> >>        //acc_cfg.transport_id = trans_id;
>> >>        //acc_cfg.
>> >>
>> >>        //acc_cfg.r
>> >>
>> >>        //
>> >>        status = pjsua_acc_set_transport(acc_id,trans_id);
>> >
>> >
>> > First of all, you don't have to call pjsua_acc_set_transport() unless
>> > you
>> > really want to. With the default behavior (by not calling this
>> > function),
>> > account can use any available transports, and normally this is the
>> > desired
>> > behavior for typical applications.
>> >
>> > The pjsua_acc_set_transport() is provided for applications that want
>> > explicit control on which transport to use to send/receive messages, for
>> > example in multi-homed host and when application specificly wants to
>> > send/receive messages using a specific interface.
>> >
>> >
>> >
>> >>
>> >>
>> >>        status = pjsua_acc_add(&acc_cfg,PJ_TRUE,&acc_id);
>> >>        if(status != PJ_SUCCESS)
>> >>        {
>> >>                error_exit("Error in registration", status);
>> >>        }
>> >>
>> >> now I get error saying unsupported transport.
>> >>
>> >> When I checked the code. I found that in
>> >> pjsua_acc_create_uac_contact() it checks for the transport type in URI
>> >>
>> >> if (PJSIP_URI_SCHEME_IS_SIPS(sip_uri))
>> >>        tp_type = PJSIP_TRANSPORT_TLS;
>> >>    else if (sip_uri->transport_param.slen == 0) {
>> >>        tp_type = PJSIP_TRANSPORT_UDP;
>> >>    } else
>> >>        tp_type =
>> >> pjsip_transport_get_type_from_name(&sip_uri->transport_param);
>> >>
>> >>    if (tp_type == PJSIP_TRANSPORT_UNSPECIFIED)
>> >>        return PJSIP_EUNSUPTRANSPORT;
>> >>
>> >>
>> >> Now how can I specify value for transport_param? I am not giving
>> >> anything to get the transport other than UDP (I have not found it ).
>> >>
>> >
>> > Please see http://trac.pjsip.org/repos/wiki/FAQ#tcp
>> >
>> > Cheers
>> >  Benny
>> >
>> >
>> >
>> >>
>> >> BR
>> >>
>> >> Zahed
>> >>
>> >> _______________________________________________
>> >> 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
>> >
>> >
>> > _______________________________________________
>> > 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
>> >
>> >
>>
>> _______________________________________________
>> 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
>
>
> _______________________________________________
> 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
>
>



[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux