Re: [Sofia-sip-devel] nta outgoing create: invalid URI

2016-01-08 Thread Michael Jerris
That's really strange, that's the right code.  I'll have to take a look

On Friday, January 8, 2016, Anand Mistry <anand.mis...@einfochips.com>
wrote:

> Thanks for the reply Michael
>
> Should I check out the master branch or some other branch of freeswitch
> repo?
>
> I tried compiling sofia-sip from the master branch. I am getting
> compilation errors like the following one.
>
> ../../libsofia-sip-ua/su/sofia-sip/su_log.h:107:98: error: expected
> expression before ')' token
>  #define su_llog(_l, _ll, _f, ...) _su_llog(_l, _ll, __FILE__,
> __func__, __LINE__, _f, __VA_ARGS__)
>
> I tried with the cross-compiler and also with UBUNTU's native x86_64
> compiler. Both complain whenever they reach such macros(__VA_ARGS__).
> I tried replacing such macros with blank ones, but then some other issues
> appears somewhere else and so on.
>
> This is how i am compiling
> step 1 >>>  sh ./autogen.sh
> step 2 >>>  sh ./configure
> step 3 >>>  sh make
>
> Please let me know if i missed something.
>
>
>
> Thanks and Regards,
> Anand Mistry
> Engineer | PES
>
> Product Engineering Services
> Software | Embedded | Semiconductor Frost & Sullivan Company of the Year
> 2013-2014
>
>
> --
> *From:* Michael Jerris <m...@jerris.com
> <javascript:_e(%7B%7D,'cvml','m...@jerris.com');>>
> *Sent:* 07 January 2016 19:56
> *To:* Anand Mistry
> *Cc:* Alexsander Petry; sofia-sip-devel@lists.sourceforge.net
> <javascript:_e(%7B%7D,'cvml','sofia-sip-devel@lists.sourceforge.net');>
> *Subject:* Re: [Sofia-sip-devel] nta outgoing create: invalid URI
>
> this issue sounds really familiar but I looked yesterday and could not
> find where we hit it or fixed it in the past.  Just to eliminate could you
> try the Sofia-sip code from inside the FreeSWITCH codebase and see if it
> resolves this issue or not, we have a variety of patches in that codebase
>
> On Thursday, January 7, 2016, Anand Mistry <anand.mis...@einfochips.com
> <javascript:_e(%7B%7D,'cvml','anand.mis...@einfochips.com');>> wrote:
>
>> Hello Alex,
>>
>>
>> Thanks for the the quick reply. Please find the answers below
>>
>>
>> > If you just tried the old .so, try to compile the code again with the
>> old compiler (GCC 4.7.2).
>> It is freshly compiled.
>>
>> > Try to add some SU_DEBUG_3 call to measure where invalid becomes < 0.
>> I've found out that the only call which is executed is the following one
>> invalid = nta_tpn_by_url(home, orq->orq_tpn, , ,
>>(url_string_t *)sip->sip_request->rq_url);
>>
>> > Try to initialize invalid with 0.
>> Tried that, got same results.
>>
>> > If nothing helps, turn on all log levels and let me know.
>> I've attached the logs to the mail.
>>
>> In order to give more clearity, i am sharing my findings till now.
>> It seems that the sip->sip_request pointer is over-written by the call to
>> msg_header_add()
>>
>> This is the call chain which produces differing results
>>  session_include_description()   --->   sip_header_insert(msg, sip,
>> (sip_header_t *)pl) < 0) --->   msg_header_add()
>>
>> Also please refer to the following attached files for more info.
>>   new_log  - logs of new toolchain binaries
>>   old_logs - logs of old toolchain binaries
>>   msg_header_insert.txt- changes made to function
>>   outgoing_create.txt  - changes made to function
>>   session_inclde_description.txt - changes made to function
>>
>> Notable points : please note the change in address of sip->sip_request
>> #### session_include_description2 sip=90045c sip->msg_request=900798
>>
>>
>> Thanks and Regards,
>> Anand Mistry
>> Engineer | PES
>>
>> Product Engineering Services
>> Software | Embedded | Semiconductor Frost & Sullivan Company of the Year
>> 2013-2014
>>
>>
>> --
>> *From:* Alexsander Petry <alexsanderpe...@gmail.com>
>> *Sent:* 06 January 2016 20:53
>> *To:* sofia-sip-devel@lists.sourceforge.net
>> *Subject:* Re: [Sofia-sip-devel] nta outgoing create: invalid URI
>>
>> If you just tried the old .so, try to compile the code again with the old
>> compiler (GCC 4.7.2).
>>
>> By the sofia code (libsofia-sip-ua/nta/nta.c), "nta outgoing create:
>> invalid URI" message appears when "invalid < 0", and invalid is assigned
>> in three places:
>> invalid = tport_name_dup(ho

Re: [Sofia-sip-devel] nta outgoing create: invalid URI

2016-01-08 Thread Anand Mistry
Thanks for the reply Michael

Should I check out the master branch or some other branch of freeswitch repo?

I tried compiling sofia-sip from the master branch. I am getting compilation 
errors like the following one.

../../libsofia-sip-ua/su/sofia-sip/su_log.h:107:98: error: expected 
expression before ')' token
 #define su_llog(_l, _ll, _f, ...) _su_llog(_l, _ll, __FILE__, __func__, 
__LINE__, _f, __VA_ARGS__)

I tried with the cross-compiler and also with UBUNTU's native x86_64 compiler. 
Both complain whenever they reach such macros(__VA_ARGS__).
I tried replacing such macros with blank ones, but then some other issues 
appears somewhere else and so on.

This is how i am compiling
step 1 >>>  sh ./autogen.sh
step 2 >>>  sh ./configure
step 3 >>>  sh make

Please let me know if i missed something.


Thanks and Regards,
Anand Mistry
Engineer | PES

[https://gallery.einfochips.com/Sign.png]
Product Engineering Services
Software | Embedded | Semiconductor
Frost & Sullivan Company of the Year 2013-2014



From: Michael Jerris <m...@jerris.com>
Sent: 07 January 2016 19:56
To: Anand Mistry
Cc: Alexsander Petry; sofia-sip-devel@lists.sourceforge.net
Subject: Re: [Sofia-sip-devel] nta outgoing create: invalid URI

this issue sounds really familiar but I looked yesterday and could not find 
where we hit it or fixed it in the past.  Just to eliminate could you try the 
Sofia-sip code from inside the FreeSWITCH codebase and see if it resolves this 
issue or not, we have a variety of patches in that codebase

On Thursday, January 7, 2016, Anand Mistry 
<anand.mis...@einfochips.com<mailto:anand.mis...@einfochips.com>> wrote:

Hello Alex,


Thanks for the the quick reply. Please find the answers below

> If you just tried the old .so, try to compile the code again with the old 
> compiler (GCC 4.7.2).
It is freshly compiled.

> Try to add some SU_DEBUG_3 call to measure where invalid becomes < 0.
I've found out that the only call which is executed is the following one
invalid = nta_tpn_by_url(home, orq->orq_tpn, , ,
   (url_string_t *)sip->sip_request->rq_url);

> Try to initialize invalid with 0.
Tried that, got same results.

> If nothing helps, turn on all log levels and let me know.
I've attached the logs to the mail.

In order to give more clearity, i am sharing my findings till now.
It seems that the sip->sip_request pointer is over-written by the call to 
msg_header_add()

This is the call chain which produces differing results
 session_include_description()   --->   sip_header_insert(msg, sip, 
(sip_header_t *)pl) < 0) --->   msg_header_add()

Also please refer to the following attached files for more info.
  new_log  - logs of new toolchain binaries
  old_logs - logs of old toolchain binaries
  msg_header_insert.txt- changes made to function
  outgoing_create.txt  - changes made to function
  session_inclde_description.txt - changes made to function

Notable points : please note the change in address of sip->sip_request
 session_include_description2 sip=90045c sip->msg_request=900798


Thanks and Regards,
Anand Mistry
Engineer | PES

[https://gallery.einfochips.com/Sign.png]
Product Engineering Services
Software | Embedded | Semiconductor
Frost & Sullivan Company of the Year 2013-2014



From: Alexsander Petry <alexsanderpe...@gmail.com>
Sent: 06 January 2016 20:53
To: sofia-sip-devel@lists.sourceforge.net
Subject: Re: [Sofia-sip-devel] nta outgoing create: invalid URI

If you just tried the old .so, try to compile the code again with the old 
compiler (GCC 4.7.2).

By the sofia code (libsofia-sip-ua/nta/nta.c), "nta outgoing create: invalid 
URI" message appears when "invalid < 0", and invalid is assigned in three 
places:
invalid = tport_name_dup(home, orq->orq_tpn, tpn);
invalid = nta_tpn_by_url(home, orq->orq_tpn, , , route_url);
invalid = nta_tpn_by_url(home, orq->orq_tpn, , , (url_string_t 
*)sip->sip_request->rq_url);

Try to add some SU_DEBUG_3 call to measure where invalid becomes < 0.

And... invalid is not initialized! Look.. int invalid, resolved = 0, stateless 
= 0, user_via = agent->sa_user_via;
Try to initialize invalid with 0.

If nothing helps, turn on all log levels and let me know.


On Wed, Jan 6, 2016 at 10:32 AM, Anand Mistry <anand.mis...@einfochips.com> 
wrote:


Hello,


I am working on this issue for a quite long time. Still I am unable to fix 
this. And I need some help.


Recently we updated our build system (compiler, automake, etc.). However we 
kept the same sofia-sip library version (1.12.10). It compiles well. But it 
gives the following error whenever we try to place a call.


nta outgoing create: invalid URI


For testing, we are using the sofsip_cli client 
(http://sourceforge.net/pr

Re: [Sofia-sip-devel] nta outgoing create: invalid URI

2016-01-07 Thread Michael Jerris
this issue sounds really familiar but I looked yesterday and could not find
where we hit it or fixed it in the past.  Just to eliminate could you try
the Sofia-sip code from inside the FreeSWITCH codebase and see if it
resolves this issue or not, we have a variety of patches in that codebase

On Thursday, January 7, 2016, Anand Mistry <anand.mis...@einfochips.com>
wrote:

> Hello Alex,
>
>
> Thanks for the the quick reply. Please find the answers below
>
>
> > If you just tried the old .so, try to compile the code again with the
> old compiler (GCC 4.7.2).
> It is freshly compiled.
>
> > Try to add some SU_DEBUG_3 call to measure where invalid becomes < 0.
> I've found out that the only call which is executed is the following one
> invalid = nta_tpn_by_url(home, orq->orq_tpn, , ,
>(url_string_t *)sip->sip_request->rq_url);
>
> > Try to initialize invalid with 0.
> Tried that, got same results.
>
> > If nothing helps, turn on all log levels and let me know.
> I've attached the logs to the mail.
>
> In order to give more clearity, i am sharing my findings till now.
> It seems that the sip->sip_request pointer is over-written by the call to
> msg_header_add()
>
> This is the call chain which produces differing results
>  session_include_description()   --->   sip_header_insert(msg, sip,
> (sip_header_t *)pl) < 0) --->   msg_header_add()
>
> Also please refer to the following attached files for more info.
>   new_log  - logs of new toolchain binaries
>   old_logs - logs of old toolchain binaries
>   msg_header_insert.txt- changes made to function
>   outgoing_create.txt  - changes made to function
>   session_inclde_description.txt - changes made to function
>
> Notable points : please note the change in address of sip->sip_request
>  session_include_description2 sip=90045c sip->msg_request=900798
>
>
> Thanks and Regards,
> Anand Mistry
> Engineer | PES
>
> Product Engineering Services
> Software | Embedded | Semiconductor Frost & Sullivan Company of the Year
> 2013-2014
>
>
> --
> *From:* Alexsander Petry <alexsanderpe...@gmail.com
> <javascript:_e(%7B%7D,'cvml','alexsanderpe...@gmail.com');>>
> *Sent:* 06 January 2016 20:53
> *To:* sofia-sip-devel@lists.sourceforge.net
> <javascript:_e(%7B%7D,'cvml','sofia-sip-devel@lists.sourceforge.net');>
> *Subject:* Re: [Sofia-sip-devel] nta outgoing create: invalid URI
>
> If you just tried the old .so, try to compile the code again with the old
> compiler (GCC 4.7.2).
>
> By the sofia code (libsofia-sip-ua/nta/nta.c), "nta outgoing create:
> invalid URI" message appears when "invalid < 0", and invalid is assigned
> in three places:
> invalid = tport_name_dup(home, orq->orq_tpn, tpn);
> invalid = nta_tpn_by_url(home, orq->orq_tpn, , , route_url);
> invalid = nta_tpn_by_url(home, orq->orq_tpn, , , (url_string_t
> *)sip->sip_request->rq_url);
>
> Try to add some SU_DEBUG_3 call to measure where invalid becomes < 0.
>
> And... invalid is not initialized! Look.. int invalid, resolved = 0,
> stateless = 0, user_via = agent->sa_user_via;
> Try to initialize invalid with 0.
>
> If nothing helps, turn on all log levels and let me know.
>
>
> On Wed, Jan 6, 2016 at 10:32 AM, Anand Mistry <anand.mis...@einfochips.com
> <javascript:_e(%7B%7D,'cvml','anand.mis...@einfochips.com');>> wrote:
>
>>
>> Hello,
>>
>>
>> I am working on this issue for a quite long time. Still I am unable to
>> fix this. And I need some help.
>>
>>
>> Recently we updated our build system (compiler, automake, etc.). However
>> we kept the same sofia-sip library version (1.12.10). It compiles well. But
>> it gives the following error whenever we try to place a call.
>>
>>
>> nta outgoing create: invalid URI
>>
>> For testing, we are using the sofsip_cli client (
>> http://sourceforge.net/projects/sofia-sip/files/sofsip-cli/). We checked
>> the URI, it is correct. The URI we used is "<sip:toto@10.102.2.180
>> <javascript:_e(%7B%7D,'cvml','sip:toto@10.102.2.180');>>". It works if
>> we use the older sofia-sip library ".so" files, with those compiled using
>> previous compiler, but facing problem when using the newer ones.
>>
>> Has anybody faced this problem before? What is the solution/workaround?
>> Please help.
>> We also tried to use the latest version of sofia-sip library, but found
>> the same results.
>>
>> Additional information:
>> - Tar

[Sofia-sip-devel] nta outgoing create: invalid URI

2016-01-06 Thread Anand Mistry

Hello,


I am working on this issue for a quite long time. Still I am unable to fix 
this. And I need some help.


Recently we updated our build system (compiler, automake, etc.). However we 
kept the same sofia-sip library version (1.12.10). It compiles well. But it 
gives the following error whenever we try to place a call.


nta outgoing create: invalid URI


For testing, we are using the sofsip_cli client 
(http://sourceforge.net/projects/sofia-sip/files/sofsip-cli/). We checked the 
URI, it is correct. The URI we used is "". It works if 
we use the older sofia-sip library ".so" files, with those compiled using 
previous compiler, but facing problem when using the newer ones.

Has anybody faced this problem before? What is the solution/workaround? Please 
help.
We also tried to use the latest version of sofia-sip library, but found the 
same results.

Additional information:
- Target system  = ARM based custom board
- Previous compiler = GCC (4.7.2)
- Current compiler = GCC (4.9.1)

Thanks and Regards,
Anand Mistry
Engineer | PES

[https://gallery.einfochips.com/Sign.png]
Product Engineering Services
Software | Embedded | Semiconductor
Frost & Sullivan Company of the Year 2013-2014
*
 eInfochips Business Disclaimer: This e-mail message and all attachments 
transmitted with it are intended solely for the use of the addressee and may 
contain legally privileged and confidential information. If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution, copying, or other use of this message or its 
attachments is strictly prohibited. If you have received this message in error, 
please notify the sender immediately by replying to this message and please 
delete it from your computer. Any views expressed in this message are those of 
the individual sender unless otherwise stated. Company has taken enough 
precautions to prevent the spread of viruses. However the company accepts no 
liability for any damage caused by any virus transmitted by this email. 
*
--
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


Re: [Sofia-sip-devel] nta outgoing create: invalid URI

2016-01-06 Thread Alexsander Petry
If you just tried the old .so, try to compile the code again with the old
compiler (GCC 4.7.2).

By the sofia code (libsofia-sip-ua/nta/nta.c), "nta outgoing create:
invalid URI" message appears when "invalid < 0", and invalid is assigned in
three places:
invalid = tport_name_dup(home, orq->orq_tpn, tpn);
invalid = nta_tpn_by_url(home, orq->orq_tpn, , , route_url);
invalid = nta_tpn_by_url(home, orq->orq_tpn, , , (url_string_t
*)sip->sip_request->rq_url);

Try to add some SU_DEBUG_3 call to measure where invalid becomes < 0.

And... invalid is not initialized! Look.. int invalid, resolved = 0,
stateless = 0, user_via = agent->sa_user_via;
Try to initialize invalid with 0.

If nothing helps, turn on all log levels and let me know.


On Wed, Jan 6, 2016 at 10:32 AM, Anand Mistry 
wrote:

>
> Hello,
>
>
> I am working on this issue for a quite long time. Still I am unable to fix
> this. And I need some help.
>
>
> Recently we updated our build system (compiler, automake, etc.). However
> we kept the same sofia-sip library version (1.12.10). It compiles well. But
> it gives the following error whenever we try to place a call.
>
>
> nta outgoing create: invalid URI
>
> For testing, we are using the sofsip_cli client (
> http://sourceforge.net/projects/sofia-sip/files/sofsip-cli/). We checked
> the URI, it is correct. The URI we used is "". It
> works if we use the older sofia-sip library ".so" files, with those
> compiled using previous compiler, but facing problem when using the newer
> ones.
>
> Has anybody faced this problem before? What is the solution/workaround?
> Please help.
> We also tried to use the latest version of sofia-sip library, but found
> the same results.
>
> Additional information:
> - Target system  = ARM based custom board
> - Previous compiler = GCC (4.7.2)
> - Current compiler = GCC (4.9.1)
>
> Thanks and Regards,
> Anand Mistry
> Engineer | PES
>
> Product Engineering Services
> Software | Embedded | Semiconductor Frost & Sullivan Company of the Year
> 2013-2014
> *
> eInfochips Business Disclaimer: This e-mail message and all attachments
> transmitted with it are intended solely for the use of the addressee and
> may contain legally privileged and confidential information. If the reader
> of this message is not the intended recipient, or an employee or agent
> responsible for delivering this message to the intended recipient, you are
> hereby notified that any dissemination, distribution, copying, or other use
> of this message or its attachments is strictly prohibited. If you have
> received this message in error, please notify the sender immediately by
> replying to this message and please delete it from your computer. Any views
> expressed in this message are those of the individual sender unless
> otherwise stated. Company has taken enough precautions to prevent the
> spread of viruses. However the company accepts no liability for any damage
> caused by any virus transmitted by this email.
> *
>
>
>
> --
>
> ___
> Sofia-sip-devel mailing list
> Sofia-sip-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel
>
>


-- 
Alexsander Petry
--
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


Re: [Sofia-sip-devel] nta outgoing create: invalid URI

2016-01-06 Thread Anand Mistry
Hello Alex,


Thanks for the the quick reply. Please find the answers below

> If you just tried the old .so, try to compile the code again with the old 
> compiler (GCC 4.7.2).
It is freshly compiled.

> Try to add some SU_DEBUG_3 call to measure where invalid becomes < 0.
I've found out that the only call which is executed is the following one
invalid = nta_tpn_by_url(home, orq->orq_tpn, , ,
   (url_string_t *)sip->sip_request->rq_url);

> Try to initialize invalid with 0.
Tried that, got same results.

> If nothing helps, turn on all log levels and let me know.
I've attached the logs to the mail.

In order to give more clearity, i am sharing my findings till now.
It seems that the sip->sip_request pointer is over-written by the call to 
msg_header_add()

This is the call chain which produces differing results
 session_include_description()   --->   sip_header_insert(msg, sip, 
(sip_header_t *)pl) < 0) --->   msg_header_add()

Also please refer to the following attached files for more info.
  new_log  - logs of new toolchain binaries
  old_logs - logs of old toolchain binaries
  msg_header_insert.txt- changes made to function
  outgoing_create.txt  - changes made to function
  session_inclde_description.txt - changes made to function

Notable points : please note the change in address of sip->sip_request
 session_include_description2 sip=90045c sip->msg_request=900798


Thanks and Regards,
Anand Mistry
Engineer | PES

[https://gallery.einfochips.com/Sign.png]
Product Engineering Services
Software | Embedded | Semiconductor
Frost & Sullivan Company of the Year 2013-2014



From: Alexsander Petry <alexsanderpe...@gmail.com>
Sent: 06 January 2016 20:53
To: sofia-sip-devel@lists.sourceforge.net
Subject: Re: [Sofia-sip-devel] nta outgoing create: invalid URI

If you just tried the old .so, try to compile the code again with the old 
compiler (GCC 4.7.2).

By the sofia code (libsofia-sip-ua/nta/nta.c), "nta outgoing create: invalid 
URI" message appears when "invalid < 0", and invalid is assigned in three 
places:
invalid = tport_name_dup(home, orq->orq_tpn, tpn);
invalid = nta_tpn_by_url(home, orq->orq_tpn, , , route_url);
invalid = nta_tpn_by_url(home, orq->orq_tpn, , , (url_string_t 
*)sip->sip_request->rq_url);

Try to add some SU_DEBUG_3 call to measure where invalid becomes < 0.

And... invalid is not initialized! Look.. int invalid, resolved = 0, stateless 
= 0, user_via = agent->sa_user_via;
Try to initialize invalid with 0.

If nothing helps, turn on all log levels and let me know.


On Wed, Jan 6, 2016 at 10:32 AM, Anand Mistry 
<anand.mis...@einfochips.com<mailto:anand.mis...@einfochips.com>> wrote:


Hello,


I am working on this issue for a quite long time. Still I am unable to fix 
this. And I need some help.


Recently we updated our build system (compiler, automake, etc.). However we 
kept the same sofia-sip library version (1.12.10). It compiles well. But it 
gives the following error whenever we try to place a call.


nta outgoing create: invalid URI


For testing, we are using the sofsip_cli client 
(http://sourceforge.net/projects/sofia-sip/files/sofsip-cli/). We checked the 
URI, it is correct. The URI we used is 
"<sip:toto@10.102.2.180<mailto:sip%3Atoto@10.102.2.180>>". It works if we use 
the older sofia-sip library ".so" files, with those compiled using previous 
compiler, but facing problem when using the newer ones.

Has anybody faced this problem before? What is the solution/workaround? Please 
help.
We also tried to use the latest version of sofia-sip library, but found the 
same results.

Additional information:
- Target system  = ARM based custom board
- Previous compiler = GCC (4.7.2)
- Current compiler = GCC (4.9.1)

Thanks and Regards,
Anand Mistry
Engineer | PES

[https://gallery.einfochips.com/Sign.png]
Product Engineering Services
Software | Embedded | Semiconductor
Frost & Sullivan Company of the Year 2013-2014
*
 eInfochips Business Disclaimer: This e-mail message and all attachments 
transmitted with it are intended solely for the use of the addressee and may 
contain legally privileged and confidential information. If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution, copying, or other use of this message or its 
attachments is strictly prohibited. If you have received this message in error, 
please notify the sender immediately by replying to this message and please 
delete it from your computer. Any views expressed 

[Sofia-sip-devel] nta outgoing create: invalid URI

2008-07-04 Thread Fan Xing


Dear all,

  I was trying 
to use sofia_sip to write some simple codes, which is supposed to send a text 
message to another client. However, when I execute, I receive an error message 
saying 'nta outgoing create: invalid URI.' 

   Anyone can kindly give me some hints on how to fix the problem? Thanks a lot!

Best regards,
Stella

  The exact output is like this:
_
 create operation handle: OK
nta outgoing create: invalid URI
send msg: OK
entering main loop for processing of messages

Than the progam just hang there, before entering main loop
_


My code is something like this:

//
/* include all the header files */


#define SOFSIP_USE_GLIB_EVENT_LOOP 1

void event_callback(nua_event_t   event,
int   status,
char const   *phrase,
nua_t*nua,
nua_magic_t  *magic,
nua_handle_t *nh,
nua_hmagic_t *hmagic,
sip_t const  *sip,
tagi_ttags[]);


typedef struct cli_s {
 su_home_t cli_home[1];/*  memory home */
 su_root_t*cli_root;   /*  Pointer to application root object */
 nua_t*cli_nua;/*  Pointer to nua stack object */
} cli_t ;

static cli_t cli[1] = sizeof(cli);
 
void main()

{
 sipinit();
 send_message(star03, sip:111.111.112.64)
 runsipmainloop()
 sipcleanup()
} 

int sipinit(void)
{

/* step: initialize glib and gstreamer */
 #if HAVE_GLIB
   g_type_init(); 
 #if HAVE_GST
 {
  guint major, minor, micro, nano;
  gst_init (NULL, NULL);
  gst_version (major, minor, micro, nano);
  g_message (This program is linked against GStreamer %d.%d.%d\n, 
major, minor, micro);
  }
 #endif
 #endif
   
su_home_init(cli-cli_home);
su_init();
cli-cli_root =su_root_create(cli);
  
 if (cli-cli_root != NULL)
  {
  
cli-cli_nua = nua_create(cli-cli_root,
   event_callback, 
   cli,
   NUTAG_URL(sip:0.0.0.0:5060), 
   TAG_END());
  }

return 0;
}



/* send a text msg */
int send_message(char const *name, url_string_t const *url)
 {
 nua_handle_t *op;
 sip_to_t *to;
 
 op = su_zalloc(cli-cli_home, (sizeof (nua_handle_t *)));
 if (op==NULL) 
 { printf(can not create operation context information\n);
   return 0;
 }
   
  /*Destination address */
 to = sip_to_create(NULL,url);
 if (!to) return 0;

 to-a_display=name;
 
 op = nua_handle(cli-cli_nua, NULL, SIPTAG_TO(to), TAG_END());
  printf ( create operation handle: OK\n);


if (op==NULL)
   { printf (can not access operation handle\n);
return 0;
   }

nua_message(op, SIPTAG_CONTENT_TYPE_STR(text/plain),
 SIPTAG_PAYLOAD_STR(hello world),TAG_END());

 printf ( send msg: OK\n);
  
 return (int) op;
}



int runsipmainloop(void)
{

   if (cli-cli_nua !=NULL)
 {
   printf(entering main loop for processing of messages\n);
   su_root_run(cli-cli_root);
   printf (entered main loop);
 }
   return 0;
}

int sipcleanup(void)
{
 nua_destroy(cli-cli_nua);
 su_root_destroy(cli-cli_root);
 cli-cli_root=NULL;
 su_home_deinit(cli-cli_home);
 su_deinit();
 return 0;
}


/* This callback will be called by SIP stack to
 * process incoming events 
 */
void event_callback(nua_event_t   event,
int   status,
char const   *phrase,
nua_t*nua,
nua_magic_t  *magic,
nua_handle_t *nh,
nua_hmagic_t *hmagic,
sip_t const  *sip,
tagi_ttags[])
{   switch (event){
  case nua_i_invite:
   printf(invitation has been sent); 
  break;

  case nua_i_active:
 printf(receive invitation);  
break;

  case nua_r_invite:
 printf(responseinvitation);  
 break;

  defult:
printf(unkown event);

  }
}

//








_
Making the world a better place one message at a time.
http://www.imtalkathon.com/?source=EML_WLH_Talkathon_BetterPlace-
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08___