getting the right status from pjsua_acc_add

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

 



Hi,
I noticed that when I try to use a URI with a port that the server doesn't
support I get an error similar to this:

00:20:06.651    pjsua_acc.c  .Account sip:XXXXXX at YYYYYYYY:ZZZZZ;transport=tls
added with id 0

00:20:06.651    pjsua_acc.c  .Acc 0: setting registration..

00:20:06.651    pjsua_acc.c  ..Unable to generate suitable Contact header
for registration: Unsupported transport (PJSIP_EUNSUPTRANSPORT)
[status=171060]

00:20:06.652    pjsua_acc.c  ..Unable to create registration: Unsupported
transport (PJSIP_EUNSUPTRANSPORT) [status=171060]

and pjsua_acc_add would still return PJ_SUCCESS.

I created a patch to return the right status from pjsua_acc_add. it is
attached.

-- 

Yosi Taguri | Founder & CTO | Yalo | http://yaloapp.com
<http://ahhhpah.com>| Mobile: +972-54-4816020 | Google Voice US
Mobile: +1 (415) 935-1126 |
Email: yosi at taguri.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20140314/e6cf1cba/attachment-0001.html>
-------------- next part --------------
diff --git a/pjsip/src/pjsua-lib/pjsua_acc.c b/pjsip/src/pjsua-lib/pjsua_acc.c
index 512c45f..e19ba60 100644
--- a/pjsip/src/pjsua-lib/pjsua_acc.c
+++ b/pjsip/src/pjsua-lib/pjsua_acc.c
@@ -482,19 +482,19 @@ PJ_DEF(pj_status_t) pjsua_acc_add( const pjsua_acc_config *cfg,
     /* If accounts has registration enabled, start registration */
     if (pjsua_var.acc[id].cfg.reg_uri.slen) {
 	if (pjsua_var.acc[id].cfg.register_on_acc_add)
-            pjsua_acc_set_registration(id, PJ_TRUE);
+            status = pjsua_acc_set_registration(id, PJ_TRUE);
     } else {
 	/* Otherwise subscribe to MWI, if it's enabled */
 	if (pjsua_var.acc[id].cfg.mwi_enabled)
-	    pjsua_start_mwi(id, PJ_TRUE);
+	    status = pjsua_start_mwi(id, PJ_TRUE);
 
 	/* Start publish too */
 	if (acc->cfg.publish_enabled)
-	    pjsua_pres_init_publish_acc(id);
+	    status = pjsua_pres_init_publish_acc(id);
     }
 
     pj_log_pop_indent();
-    return PJ_SUCCESS;
+    return status;
 }
 
 


[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